Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 444 445 [446] 447 448 ... 796

Author Topic: if self.isCoder(): post() #Programming Thread  (Read 837551 times)

Moghjubar

  • Bay Watcher
  • Science gets you to space.
    • View Profile
    • Demon Legend
Re: if self.isCoder(): post() #Programming Thread
« Reply #6675 on: November 21, 2014, 04:53:08 am »

Logged
Steam ID
Making things in Unity
Current Project: Demon Legend
Also working on THIS! Farworld Pioneers
Mastodon

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #6676 on: November 21, 2014, 04:54:41 am »

If you can dodge a tank shot you can dodge a bullet!

Wait, that actually makes sense



Anyhow, the stream idea itself is really cool.

edit: I use Cherrypy for the backend. I'm trying to think of a way to store information the clients send to the server, and I'm starting to think that I'll have to use SQL in the end :| It's a lot of effort to write and test my own database structure while also keeping it efficient and stuff. But making a database and learning SQL or a library like SQLAlchemy sounds like a lot of work T_T Only if there were a really simple database that supports a JSON-like data structure...
« Last Edit: November 21, 2014, 05:14:09 am by Skyrunner »
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6677 on: November 21, 2014, 05:13:59 am »

Wow!

That's... ambitious.

I've made a game in pure Windows API (no middleware) before, and it's hard. The biggest sticking point will be any kind of physics/collision detection, though certain kinds of game (e.g. puzzle, strategy) can avoid this.

Software 3D is also horrible to do, CPUs are surprisingly slow.
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

Orange Wizard

  • Bay Watcher
  • mou ii yo
    • View Profile
    • S M U G
Re: if self.isCoder(): post() #Programming Thread
« Reply #6678 on: November 21, 2014, 05:21:22 am »

Yeah, I raised my eyebrows at that bit. Software rendered? Are you sure about this?
Logged
Please don't shitpost, it lowers the quality of discourse
Hard science is like a sword, and soft science is like fear. You can use both to equally powerful results, but even if your opponent disbelieve your stabs, they will still die.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #6679 on: November 21, 2014, 05:23:11 am »

To be fair, he did say that he would make a software-rendered version first, then swap it out for hardware-accelerated versions if/when he needs the extra performance.

Also, does nobody have a suggestion for a database that can be accessed like JSON? That is, via the dictionary interface (dict["key"] = value)
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6680 on: November 21, 2014, 05:35:10 am »

Yeah, I raised my eyebrows at that bit. Software rendered? Are you sure about this?
Yeah, my thought too. I have a toy multi-threaded software 3d renderer I wrote for fun, and it struggles to get 130 fps rendering the inside of a cube. On a 6-core hyperthreaded cpu. 512x512 window. Bilinear-filtered texture, diffuse-only point lighting.

You might say 130 fps sounds good, but if I expanded it to a full 1080p screen I'd get a huge 14 fps. Rendering a single cube. :)
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

BlindKitty

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6681 on: November 21, 2014, 08:33:45 am »

To be fair, he did say that he would make a software-rendered version first, then swap it out for hardware-accelerated versions if/when he needs the extra performance.

Also, does nobody have a suggestion for a database that can be accessed like JSON? That is, via the dictionary interface (dict["key"] = value)

Take a look at MongoDB; it has really well support and keeps the documents as binary JSON (BSON) internally. Or you can take a look at CouchDB, which does the same thing, but is much less known, I think (at least that's my impression after looking for various DBs on the Internet). I suppose both have some support in Python.
Logged
My little roguelike craft-centered game thread. Check it out.

GENERATION 10: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Mephisto

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6682 on: November 21, 2014, 08:37:13 am »

Also, does nobody have a suggestion for a database that can be accessed like JSON? That is, via the dictionary interface (dict["key"] = value)

I know you expressed feeling like SQLAlchemy would be a lot of work, but something like that might be the best way to get what you want if you want a SQL database.

It's not SQLAlchemy and I don't agree with everything it does, but the Django ORM has the capability to do this. Want dictionaries?
Code: [Select]
Model.objects.filter(**{stuff}).values()Now you have a list of dictionaries for every row that the filter matches.
Logged

Gentlefish

  • Bay Watcher
  • [PREFSTRING: balloon-like qualities]
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6683 on: November 21, 2014, 08:44:35 am »

Just got finished with a Perl script that backs up files and directories (recursively!) or a .backup in the user's ~/ directory. I did not use any system() calls.

It took me four hours out of my night.

The other three scripts took no more than half an hour each.

Fuck yeah.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #6684 on: November 21, 2014, 09:25:43 am »

All these database systems are incredibly complex. I'm surprised nobody has made a very simple wrapper for SQL that lets the user just pretend the db is a dict. I don't need any fancy joins or searches (or even simple ones), just key-value data with nested data structure.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6685 on: November 21, 2014, 09:49:56 am »

The "nested" is the key problem. SQL tables are flat. Any nesting comes from joins.
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
Re: if self.isCoder(): post() #Programming Thread
« Reply #6686 on: November 21, 2014, 10:08:55 am »

Yeah... nested is so nice and logical though.


Database: card sets
Set1 {
  Author: A,
  Privacy: Public,
  Content: [282,293, 294, 103]
}
...


I suppose this could be done with SQL, but nestedness is always nice to have.
Logged

bay12 lower boards IRC:irc.darkmyst.org @ #bay12lb
"Oh, they never lie. They dissemble, evade, prevaricate, confoud, confuse, distract, obscure, subtly misrepresent and willfully misunderstand with what often appears to be a positively gleeful relish ... but they never lie" -- Look To Windward

BlindKitty

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6687 on: November 21, 2014, 10:41:55 am »

Well, 'simple' and 'database' aren't exactly going all that well together. But why can't you just keep that in memory? Or dump the dictionary to the file and read/write a single JSON? To be honest, the SQL system and nested dictionaries are probably as far away from each other as data structures go, so it is not so surprising to me. It's just the fact that when you need nested data structures, the SQL is not a really good idea to achieve that. You can do that, but joins are expensive, as far as I know, and using MongoDB/CouchDB/PogreSQL/other DB would make more sense IMHO.
Logged
My little roguelike craft-centered game thread. Check it out.

GENERATION 10: The first time you see this, copy it into your sig on any forum and add 1 to the generation. Social experiment.

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6688 on: November 21, 2014, 10:47:33 am »

A traditional database like SQL is best for massive amounts of data that follows a very rigid structure, e.g. billions of money transaction records at a bank.

For a small amount of data, especially if it's extremely variable in structure, it may just be quicker to use a file.
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.

Antsan

  • Bay Watcher
    • View Profile
Re: if self.isCoder(): post() #Programming Thread
« Reply #6689 on: November 21, 2014, 01:39:04 pm »

You could change my C++ contains() to have a linked-list arg instead, it will still clone the rest of the list each iteration.
I don't see how that's relevant. The code which originally was shown (in Prolog) doesn't do any copying or cloning and the same goes for any other implementation of member I have ever seen for linked lists didn't either.
The thing is, saying "that looks expensive" and claiming that it probably would be without being some kind of super wizard programmer is not true. Writing a O(n) member check for any type of sequence recursively is trivial in any language I know, including C++.
Logged
Taste my Paci-Fist
Pages: 1 ... 444 445 [446] 447 448 ... 796