Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 5

Author Topic: GUM: Grand Unified Model—Weather shenanigans  (Read 5095 times)

Skyrunner

  • Bay Watcher
  • ?!?!
    • View Profile
    • Portfolio
GUM: Grand Unified Model—Weather shenanigans
« on: February 07, 2013, 09:56:50 am »



Grand Unified Model (GUM)

Spoiler: Unordered opinion (click to show/hide)

So: a Grand Unified Model(GUM) to simulate, in general terms, the interactions and relationships of organisms and their surroundings. A collaborative project that attempts to use the modular-ness granted by modern(ish) programming languages to best effect, and which, in the end, would be able to be adapted to many situations one wants to simulate. What a module simulates would ultimately be on the shoulders of the programmer, and not restricted by modules that are already done or in progress.

Another goal could be having a world-in-a-globe, where everything worth tracking is tracked: some modules decide what today's weather is in Bagali-anshi, some modules say that today's rain was enough to make a set of snowroot to sprout and germinate, rising above the weeds that choke the field, striving to get a foothold; the muddy roads inhibit merchants and prices rise slightly. Far off in a capital capital area, nobles struggle to rise to the top of the heap, people live people lives. Unbeknownst to the inhabitants of the great city, the local aquifer is drying out, perhaps due to changes in river-flow, which could bring sweeping drought and famine to the region...

Of course, without proper organization, the above is all a pipe dream. There has to be some sort of order to this modular chaos, and this thread will probably be the eye of the storm. I think that there have to be things to be decided on in advance to keep everything from degenerating into sphagetti-plagued chaos. It mostly involves sparse standards to follow, and a few style guides. Here is what me and alway have tossed up as a set of ideas:


GUM in short?
A modular project to allow users (probably programmers) to combine individual modules to form ordered models of phenomena, probably focusing macrophenomena such as ecologies and weather, societies and economy, more than on microphenomena like protein folding and molecules turning. The way each module implements a simulation model is up to the programmer, as long as he provides readable code, some hooks (and the willingness to add more hooks at behest), and, if it is a time-based module, a step() or update() function with a parameter, to be described below.
(Welp, that wasn't short. xD)

What language will GUM use?
Now, while there are many languages out there, and it is a hot topic, in the sense nuclear warheads tend to be hot, I think C++ is the language of choice for this. The reasons are mainly
: C++ supports object-oriented, procedural, and functional programming. It is a flexible language, especially compared to languages like Java. It is also easy to make C++ modular.
: C++ is powerful. Among the utilities it can perform are multithreading (via boost::thread), whicah is crucial for any large simulation.
: C++ can easily take advantage of 3D hardware, through DirectX or OpenGL, and be used to natively write moduels which use 3D.
If sufficient reasoning is given, a different language might be considered. But the thing is, all languages really do do the same thing. It's just syntax. :D

What are the standards you propose?
A few thought of are:
- Always #undef macros, whenever defined, at the end of your file, or alternatively create a pair of header files, one which contains all of your macros, and the other which undefines all the macros.
- Try not to use short, one letter variable names, unless when strictly needed (such as a vector's x, y, and z components).
- Readable code is better than concise code. The best is self-documenting code, the second-best is good commenting, and the third best is documentation.
- Place all resources in a content sub-directory in the main project folder. This lets merging of modules be easier, a simple matter of copying and pasting modules over each other. Along this line of thought, all include files should go into libraries/include, and all lib/a files should go into libraries/bin.
- Keep local backups in case of failure. Mercurial, and Tortoise HG for the less console-inclined people is a good way to track your versions.
- Use relative paths.
- Have hooks that other programmers could use. Alternatively, let a programmer inherit your entire module and use its members.
- If the module depends on time, always include a void step(const float& deltaTime) or void update(const float& deltaTime) of the sort. If it just has to be updated at regular intervals, include a function that accepts a float of delta Time but do nothing with it.

When multiple modules are linked, the best case would be using multithreading to run all modules in parallel.

Platforms?
Whichever the programmer uses, though performance may vary across compilers.



A module I can think of that would be good to have early on is a vector3 class. If anyone uses it, I could push my own to a repository, supporting most basic functionality.

I think that some sort of repository will have to be created. xD
Well... that's all I can think of. :c Discuss?

...Please forgive anything I might have done wrong >.>



Edit: Wait, the greatest problem is actually managing to focus interest and programmer effort o_O...
« Last Edit: April 18, 2013, 10:52:25 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

Siquo

  • Bay Watcher
  • Procedurally generated
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #1 on: February 07, 2013, 10:17:51 am »

* Siquo is expressing tentative interest.
Logged

This one thread is mine. MIIIIINE!!! And it will remain a happy, friendly, encouraging place, whether you lot like it or not. 
will rena,eme sique to sique sxds-- siquo if sucessufil
(cant spel siqou a. every speling looks wroing (hate this))

Dutchling

  • Bay Watcher
  • Ridin' with Biden
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #2 on: February 07, 2013, 10:25:53 am »

ptw
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #3 on: February 07, 2013, 10:51:26 am »

I disagree with mercurial on the basis that github is far more awesome.
Logged

Darvi

  • Bay Watcher
  • <Cript> Darvi is my wifi.
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #4 on: February 07, 2013, 10:53:06 am »

I disagree with mercurial on the basis that github is far more awesome.
Thiiiis. Unfortunately it lost most of its aweomeness when the windows application became available.
Logged

Rose

  • Bay Watcher
  • Resident Elf
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #5 on: February 07, 2013, 11:04:09 am »

I disagree with mercurial on the basis that github is far more awesome.
Thiiiis. Unfortunately it lost most of its aweomeness when the windows application became available.

Why? all the other applications still work just as well as they used to.
Logged

Darvi

  • Bay Watcher
  • <Cript> Darvi is my wifi.
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #6 on: February 07, 2013, 11:08:08 am »

But now it's easy to use git. How can you get any cred when anybody can do it?
Logged

MaximumZero

  • Bay Watcher
  • Stare into the abyss.
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #7 on: February 07, 2013, 11:30:21 am »

I am going to watch this. I am not going to understand a damn thing going on, but I am going to watch, nevertheless.
Logged
  
Holy crap, why did I not start watching One Punch Man earlier? This is the best thing.
probably figured an autobiography wouldn't be interesting

miauw62

  • Bay Watcher
  • Every time you get ahead / it's just another hit
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #8 on: February 07, 2013, 11:37:24 am »

PTW.

While I know very little about programming, I also feel that C++ would be preferred because just about every programmer knows how to use it.
Logged

Quote from: NW_Kohaku
they wouldn't be able to tell the difference between the raving confessions of a mass murdering cannibal from a recipe to bake a pie.
Knowing Belgium, everyone will vote for themselves out of mistrust for anyone else, and some kind of weird direct democracy coalition will need to be formed from 11 million or so individuals.

Gamerlord

  • Bay Watcher
  • Novice GM
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #9 on: February 07, 2013, 11:52:59 am »

Oh so definitely posting to watch.

Tiruin

  • Bay Watcher
  • Life is too short for worries
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #10 on: February 07, 2013, 12:46:36 pm »

Oh so definitely posting to watch.
^
Go Skyrunner! :D
Logged

alway

  • Bay Watcher
  • 🏳️‍⚧️
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #11 on: February 07, 2013, 02:35:07 pm »

Oh, and another thing: be sure your module can fail gracefully. Possibly output some debug info depending on the cause; but most should be able to break somehow without breaking everything else. In particular, I'm referring to things like hardware dependencies. A CUDA simulation obviously can't run on an AMD card, but neither should that keep the program as a whole from running on an AMD card. Same goes for rendering techniques and such. They don't really have to do anything to replace their functionality (that's what separate modules are for), but should at least have failsafes to keep it from causing the program to crash when something isn't supported.

As for lawyer-talk, it's probably some variant of open-source; if you do use it for other stuff, give credit, that sort of thing.

Now, for some useful links for those interested in contributing:
http://vterrain.org/ Vterrain: contains links to a large number of relevant academic papers outlining simulation techniques for a variety of phenomena ranging from plants and erosion to town layouts.
http://www.siggraph.org/publications/bibliography/ Siggraph Bibliography Search: huge paper database with search for key terms to find titles of related academic papers; only gives the names of papers, but the content can usually be found by simply googling the name of the paper; very good if you know what you want to do, but don't know how to do it and there is no section for it on vterrain.
« Last Edit: February 07, 2013, 03:31:30 pm by alway »
Logged

Techhead

  • Bay Watcher
  • Former Minister of Technological Heads
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #12 on: February 07, 2013, 02:54:39 pm »

Also posting to watch.
Logged
Engineering Dwarves' unfortunate demises since '08
WHAT?  WE DEMAND OUR FREE THINGS NOW DESPITE THE HARDSHIPS IT MAY CAUSE IN YOUR LIFE
It's like you're all trying to outdo each other in sheer useless pedantry.

MagmaMcFry

  • Bay Watcher
  • [EXISTS]
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #13 on: February 07, 2013, 03:44:31 pm »

Posting to contribute.
Logged

Normandy

  • Bay Watcher
    • View Profile
Re: GUM: Grand Unified Model, Bay12 collab
« Reply #14 on: February 07, 2013, 05:29:04 pm »

If you're looking to build just a unified simulator, I would suggest staying away from any sort of graphics. Or anything that smells remotely platform exclusive.

Note that C++ is not actually easy to make modular. In fact it's a bitch to make modular, since either you have to compile your entire codebase at runtime and statically link all of it together, or dynamically load modules at runtime. But loading modules at runtime is not only platform-specific in C++, it's compiler-option-specific (you can't even mix-and-match debug and release versions of the same exact code for the most part). Statically linking modules, or simply letting people just download the source files independent of each other, makes far more sense.

I would suggest tightening the scope of the project. Something like a more targeted version of High Level Architecture (http://en.wikipedia.org/wiki/High_Level_Architecture_(simulation)), which handles basically exactly what you're talking about (which btw, I've had some experience using. I'd be willing to help design the interfaces). Except HLA is kinda really clunky (that's what happens when you try to write a software specification that is completely platform, language, and implementation agnostic) and I'd rather not touch it if I didn't have to. And it's completely inappropriate for programming games.

Also, I would suggest:
-Banning use of the preprocessor. Templates basically do everything macros can do, but better, more type-safe, and less likely to cause programmers to froth at the mouth.
-Requiring each person to use their own personal namespace
-There is no such thing as self-documenting code. Instead use a single documentation generator, like doxygen (http://www.stack.nl/~dimitri/doxygen/)
-Require use of boost (http://www.boost.org/), and don't use relative paths. Relative paths are actually a terrible idea. Relative paths are platform and launch configuration dependent. Instead, it's usually done by having some sort of globally accessible path where people can put their stuff (c.f. http://www.boost.org/doc/libs/1_53_0/libs/filesystem/doc/index.htm)
-Not allow people to use independent libraries and instead keep a whitelist of libraries used by GUM (anyone who's programmed for a while in C++ knows why you seriously don't want to be introducing libraries left and right)
-Actually create a module system, and not just leave it to the implementing coder. This includes creating a messaging system (this probably the best way to have a unified way for objects to communicate), writing base entity and component classes (and making sure they're actually good), etc...
« Last Edit: February 07, 2013, 06:17:42 pm by Normandy »
Logged
Pages: [1] 2 3 ... 5