GDR Forum Index
Podcast Podcast
Dev Dev Logs
Search Search
RSS RSS
Register Register
Log in Log in
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - Space Game Page Previous  1, 2, 3, 4, 5  Next
View previous topic :: View next topic  
Author Message
Gil
Developer

Joined: 14 Nov 2005
Posts: 2341
Location: Belgium
PostPosted: Tue Oct 26, 2010 1:05 pm    Post subject: Reply with quote

I once switched my string-based messaging system to an enumeration-based concept and gained 80% of processing power.

Be careful with passing around strings. Bit flags work best. If you need parameters, pass them separately and don't access hundreds of them each second if you don't actually need to read them.
_________________
PoV: I had to wear pants today. Fo shame!
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Sat Nov 06, 2010 1:14 am    Post subject: Reply with quote

Yes, I think I'll go for an approach where each message type will just have a unique ID which gets passed to the receiver, accompanied by a pointer to the parameters. A centralized message encoder/decoder can be shared by all models to write/read parameters and each model can just ignore messages it doesn't want to react upon.

A special scripting encoder/decoder could then be quite easily slapped onto that if needed, which would translate between binary and string messages (entered on a console or human readable in logs and debug displays).

I still haven't started the consolidated design document (work/pain/etc./the usual excuses), just screwing around with the two year old code, trying stuff, getting to know A5 better:

_________________
0xDB
View user's profile Send private message Visit poster's website
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9441
Location: Not Finland
PostPosted: Sat Nov 06, 2010 6:14 am    Post subject: Reply with quote

Ah yes, keep good notes, please! I'm interested in hearing how A5 handles compared to A4.
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Sun Nov 14, 2010 4:00 am    Post subject: Reply with quote

Will do, though most of the time when I find something a little odd, I don't fight it, I just accept it, code it in, test it and then try to forget about it immediately. If you have any specific questions on A5 however, I'll try to answer them to the best of my knowledge.

Random oddities(only "odd" or "new" compared to A4) I can remember so far:
  • setting a color depth for the graphics initialization isn't in the function that creates the "display" (a window(can be fullscreen)) but must be accomplished by a number of calls to an option setting function with which the requested individual bit size for each of the RGBA components can be set prior to creating the display
  • there is no builtin font (so I ported the one from A4 and made a request on a.cc to get it included with A5 and there's a discussion going on about that now and so far it looks like default or system(ttf) fonts are going to be included in 5.1 or 5.2 (the files will not be included but the plan seems to be to provide functions for loading any systems default fonts via extra routines / whether or not the hardcoded default font gets included I don't know)


..back to SpaceGame:

Last weekend I thought a bit about the editor for editing all sorts of geometry data (planets, objects, ships, animations, ..) and started writing the design doc (which is far from complete but it's a start and I can see now that I will probably spend a few more weeks on the design before starting to write the editor). I'm writing the design document in some sort of pseudo-markup, thinking to myself that this way I can later write a simple little parser in C#/.NET which will turn it into to pretty html, inserting the pictures, formatting headings and stuff, so I don't have to worry about any style formatting and can concentrate on the raw information. I also thought that it might be a good idea to set up a wiki for organizing/writing the design doc.. yeah I think I might just do that. (EDIT: few hours later, wiki is all set up (edit2:switched address/subdomain))

Design Doc So Far... (mostly incoherent mumblings and lots of different ideas, each fighting for more time slices in my head, causing some sort of overwhelmed sensation and a lot of daydreaming)

Thoughts on the editor:

_________________
0xDB


Edited by 0xDB on Sun Nov 21, 2010 2:32 pm; edited 1 time
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Sat Nov 20, 2010 2:42 pm    Post subject: Reply with quote

Did I ever mention that editing a wiki from a tiny Android screen with a shitty touch screen keyboard is a real PITA?

Overall though, setting up that wiki has proven to be a good idea so far. A wiki seems to be just perfect for making up stuff on the fly.

Just type a paragraph, go over the words which spawn new thoughts/raise a need for further explainatio|design and link them to a new wiki article (which doesn't even need to exist already) and start|edit that new article simply by clicking the red link(which also does a good job at reminding you what's still to be written).

Also, editing is so simple, the syntax so easy, short and sweet..I'm thinking of switching my whole homepage for a wiki (much easier to update than the html I'm still manually editing and reuploading otherwise).
_________________
0xDB
View user's profile Send private message Visit poster's website
sonrisu
Moderator

Joined: 31 Aug 2005
Posts: 4988
Location: Silicon Valley!
PostPosted: Sat Nov 20, 2010 3:32 pm    Post subject: Reply with quote

I'm really glad to see you picking back up on this project.

Quote:
A wiki seems to be just perfect for making up stuff on the fly.

It's a good place to collect and write notes from just about anywhere. A little journal-book works well, but those are really hard to organize since you can't move pages around. :] I have a personal wiki for game ideas. Haven't touched it in a long time. I should probably update it with the latest new bits from my game.

I'm also interested in your adventures with A5. Most likely I will not go back to Allegro, but it's always good to know which libraries are doing what these days.
_________________
loomsoft :]
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Mon Nov 29, 2010 11:05 am    Post subject: Reply with quote

This last weekend was a total loss. I kept thinking about this project all the time but I just couldn't get up to work on it. Not even for five minutes. I spent almost the whole weekend sleeping and feeling bad about not working on this thing (only interrupted by watching two movies and a couple of episodes from Star Trek Voyager).
_________________
0xDB
View user's profile Send private message Visit poster's website
sonrisu
Moderator

Joined: 31 Aug 2005
Posts: 4988
Location: Silicon Valley!
PostPosted: Mon Nov 29, 2010 11:11 am    Post subject: Reply with quote

I hate this feeling. I think we've all gone through this a bunch of times. What's interesting, though, is that once you breach that initial barrier, you'll start making progress like nobody's business. I usually have so many ideas I get a little lost in thinking of where to start...

For me, I find it best to segregate a simple, easy-to-do task, and just "get it done". That could be drawing a single sprite, making a single map, or implementing a single behavior for some NPC. Once you start tackling a minor piece of work, it becomes less daunting (as a whole). At least, this works for me.

Either that, or you need to take a break and give your brain some time away from the project. :]
_________________
loomsoft :]
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10857
Location: Canadia
PostPosted: Mon Nov 29, 2010 11:31 am    Post subject: Reply with quote

Yes, I'll agree with the "do something little" sentiment. Also, I too took this past weekend (and some of the week) off. Sometimes you just need a break.
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9441
Location: Not Finland
PostPosted: Tue Nov 30, 2010 12:59 am    Post subject: Reply with quote

Me too. I did everything *but* work on my game :|

Work is a strange thing. It can be so difficult to get the ball rolling. Sonrisu's suggestion has worked for me many times in the past.
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Mon Dec 06, 2010 11:39 am    Post subject: Reply with quote

<-- new avatar (not really new, just modified the old one once again) to get into the mood

Still didn't accomplish anything for another weekend in a row and next one doesn't look like I'll have any time either but this project is on my mind all the time, day and night, wherever and whenever I am.

I will try the "do something small" approach as soon as I find some time, maybe even do something very very small like "one line of code a day" or maybe less extreme "one function a day" or "one sub-section of design doc" a day... or maybe I should try to just start coding instead of pre-designing everything.

I could start with a basic planet surface geometry generator, just to get something on screen without having to write a full general purpose game geometry editor with GUI and everything first.
_________________
0xDB
View user's profile Send private message Visit poster's website
PoV
Moderator

Joined: 21 Aug 2005
Posts: 10857
Location: Canadia
PostPosted: Mon Dec 06, 2010 11:45 am    Post subject: Reply with quote

Dennis wrote:
<-- new avatar (not really new, just modified the old one once again) to get into the mood.

Heh, nice helmet. :D
_________________
Mike Kasprzak
'eh whatever. I used to make AAA and Indie games | Ludum Dare | Blog | Tweetar
View user's profile Send private message
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Tue Dec 07, 2010 11:08 am    Post subject: Reply with quote

Heh, I'm glad it's recognizable as a helmet. I spent ages pushing the pixels of the visor glass frame to get it to look ok.
_________________
0xDB
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Sat Jan 08, 2011 10:08 am    Post subject: Reply with quote

Today, as the nose leakage finally stopped and the deep space mining operations which seemed to be going on in my head for the past week are over,
I managed to..
  • ..read code and familiarize myself with it again
  • ..start writing the technical appendix A to the design document (this information, along with all the doxygen comments will be useful to get back into it after long breaks)
  • ..find and decide upon what todo next(which is important when your mind is swamped with a million different ideas and areas of interest and you have no clue where to start)
  • ..puke out a very simple, quick and dirty, next to zero error checking, no comments template tool (should save me a lot of time and speed up the flow when creating new classes and code modules in the future (no more need for doing this file copying, renaming and text replacing by hand (I might also create more templates now for all sorts of shit I kept writing manually so far)
It works very straight forward:
It let's you pick a bunch of files.
It parses the filenames and file contents for shit looking like this ###shit### and based on that slaps a few input boxes into its GUI where you can enter values.
Upon pressing the "Go!" button it replaces the ###shit### items in the filenames and inside the files with the values entered and creates new files from each source file with the replacements.

(I only wrote it because I couldn't find an existing piece of free software which does just that. If anyone knows some sophisticated templating software which does this and more, link please!)

screenshot of the TemplateTool to illustrate what it does ( (C#/.NET3.5) source code is included in the archive above in case anyone wants to add features(saving/loading of the current state(sourcefile list/working folder/current template values) would be neat, also optional default values (e.g. ###name|defaultValue### would be nice too):

_________________
0xDB
View user's profile Send private message Visit poster's website
xearthianx
Developer

Joined: 28 Sep 2006
Posts: 771
Location: USA! USA!
PostPosted: Sat Jan 08, 2011 4:48 pm    Post subject: Reply with quote

A very simple shell script could do the same thing. But I don't see much point in doing that because you already have the working tool.

I'm curious what the motivation is for typedefing a pointer to a class. I've seen this done a lot with structs in older C code, but seems totally superfluous to me in C++.
_________________
Ionoclast Laboratories - Scientia et Dominatia!
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Sat Jan 08, 2011 9:34 pm    Post subject: Reply with quote

There are two reasons for the typedef, one being a simple matter of aesthetics and readability, the other one being a health related strategy to avoid muscle pain

1.) The code is cleaner/easier to read in my mind (every special character somehow destroys the flow of the code ringing through my head).
It might not be that obvious with simple pointers to classes but it becomes more important to me with function pointers (and also helps me to see more easily whether some method returns a pointer to an object or a method).
simple example:
typedef int (*fptrAddHandler)(int, int);

a function taking a pointer to a function with that predefined signature can now be cleanly written like

void Add(fptrAddHandler addHandler, int a, int b);

which reads more easily than

void Add(int(*addHandler)(int,int),int a, int b);

The difference in readability becomes all the more obvious when using a function pointer as a return value:

fptrAddHandler GetAddHandler(int whichAddHandler);

is much easier on the eyes than

int (*GetAddHandler(int whichAddHandler))(int,int);
(also, see 2., the typedeffed version eliminates a lot of unnecessary and painful extra keypresses)

2.) pressing SHIFT+<anything> on the keyboard or repeatedly having to move arms over too long distances to reach special keys while happily hacking out code all work towards cramps and neck/back pain, so I prefer to stay with just the regular characters (abcd...) as much as possible (I'm even thinking of completely abandoning the CamelCase style and switching to lowercaseallthewaybecausewordboundariesareusuallyobviousfromcontextanyway)
_________________
0xDB
View user's profile Send private message Visit poster's website
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9441
Location: Not Finland
PostPosted: Sun Jan 09, 2011 7:41 am    Post subject: Reply with quote

'Ello chaps. I'm a missionary from the Church of the Underscore. would_anyone_care_to_convert?
View user's profile Send private message Visit poster's website
xearthianx
Developer

Joined: 28 Sep 2006
Posts: 771
Location: USA! USA!
PostPosted: Sun Jan 09, 2011 10:09 am    Post subject: Reply with quote

if we're talking keystroke economy, underscores are even worse than CamelCase :)
_________________
Ionoclast Laboratories - Scientia et Dominatia!
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9441
Location: Not Finland
PostPosted: Sun Jan 09, 2011 11:24 am    Post subject: Reply with quote

On my trusty mechanical keyboard, I can switch hands and gain a stroke ;)


Thread successfully derailed. Mission accomplished. Returning to base.
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Sun Jan 09, 2011 1:51 pm    Post subject: Reply with quote

Well, since I already want magic to have its place in the universe of SpaceGame, I might just as well want to have religious lunatics in it as well, even better if they're a funny personified caricature of certain code conventions. So the Church Of The Underscore(*) might just end up as a faction in SpaceGame (and of course they'll be fighting the CamelCasians).

Today was a strange day. I woke up early, fired up the IDE, started writing code, then kept having doubts and second thoughts about what I just wrote, threw it away, rewrote it, threw it away again, decided to do the whole thing completely different (the MessageCodec class and how I'll pass around parameters in a flexible way)... revised my todo list several times over the day throwing away items, adding new ones again, only to throw those away as well after some time until finally coming to something simple and flexible enough that I wonder why I didn't think of it like this right from the start. Meh, so well, most of the day was wasted but about two hours before bedtime I finally managed to clear my thoughts and write an easy to use and very simple BinaryData class which I'll use to prepare and pass around stuff in a unified way in my messages.

I also extended my class template a bit to save even more keystrokes.

(*) I don't mind reading underscorian code (I even wrote a lot of that myself in other projects (e.g. F.S.a.)) but I don't write it any more, simply because of the extra keypresses involved in that.
_________________
0xDB
View user's profile Send private message Visit poster's website
xearthianx
Developer

Joined: 28 Sep 2006
Posts: 771
Location: USA! USA!
PostPosted: Mon Jan 10, 2011 2:27 pm    Post subject: Reply with quote

church_of_the_underscore();
_________________
Ionoclast Laboratories - Scientia et Dominatia!
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Wed Jan 12, 2011 1:09 pm    Post subject: Reply with quote

"*chrr..* Attention all hands! This is the captain speaking. We are about to board an enemy freighter which, according to our scans is carrying approximately 2k boxes of gold pressed underscores, in t minus 5 minutes. Last chance to go to the bathroom now! *chrrzzz*"

Background:
When I was busy trying to sleep last night, I had this idea that every character/creature in the game would have to eat and drink regularly. So each crew member would have hunger-/thirst-/digestion cycle-/bladder fill level- -bars in their stats.

A full bladder would negatively affect just about any other skills chance of success due to the decreased capability to concentrate. Also, not paying attention to that might end up in an embarrassing disaster while trying to intimidate an enemy vessels captain at gunpoint.

As a consequence, there could be special upgrades (available for sale at a decent price) to all the space suits which would automatically take care of recycling anything the body of the wearing crew-member throws out (like the Fremen suits in Dune).
_________________
0xDB
View user's profile Send private message Visit poster's website
Sirocco
Moderator

Joined: 19 Aug 2005
Posts: 9441
Location: Not Finland
PostPosted: Wed Jan 12, 2011 1:40 pm    Post subject: Reply with quote

That's.... different. Are you sure that would add anything to the game, other than annoyance? I could see having having character 'wellness' rolled into a single stat, where things like food/sleep/fatigue cause the bar to fluctuate, and getting a good meal and a night of sleep would top it off.

You could quickly runs into a "Sims" scenario, where you are always running around doing things to keep your bars up instead of doing what you actually want. Hmmm... kinda like real life :(
_________________
NoOP / Reyn Time -- The $ is screwing everyone these days. (0xDB)
View user's profile Send private message Visit poster's website
Gil
Developer

Joined: 14 Nov 2005
Posts: 2341
Location: Belgium
PostPosted: Wed Jan 12, 2011 3:39 pm    Post subject: Reply with quote

It's a great idea, but distill, distill, distill!

If two stats have no discernible difference gameplay wise, turn them into 1 stat.

Hunger and thirst could go into one stat (supply?), comfort into another. Adding comfort items (waste recycling suits, better flight chairs, regenerative cryo tubes) adds to comfort. The player doesn't care about the difference between bladder comfort and ergonomic comfort when shooting OMGLAZRS

Edit: Why do not distill comfort and supplies? They are discernible gameplay wise, in that a comfot item is one-time ship upgrade, whereas the hunger/thirst stat depends on monthly supplies. If you can come up with a great gameplay hook to add medical facilities that are different from just another ship upgrade, add a health stat, otherwise, distill comfort and health into general "wellness".

I do see possible cool gameplay mechanics regarding health though and maybe you already have combat related uses for health, although there is a difference between "general health" and "immediate health issues (aka injuries)".
_________________
PoV: I had to wear pants today. Fo shame!
View user's profile Send private message Visit poster's website
0xDB
Developer

Joined: 26 Dec 2005
Posts: 1655
Location: Your consciousness.
PostPosted: Sat Jan 15, 2011 10:51 am    Post subject: Reply with quote

Sirocco wrote:
That's.... different. Are you sure that would add anything to the game, other than annoyance?
I think it would add an extra level of detail/deepness to it, so it's more like a simulation than a game. But your next point (commented below) is very valid so I might need to think about this as being optional or maybe a part of the simulation which is only active on a higher than the normal difficulty level. Maybe the difficulty level should even be customizable by allowing to turn on/off different subsystems of the simulation.
Maybe it should not be refferred to as difficulty level and instead be named more emotianally neutral like "simulation level of detail" or "starting conditions".

Sirocco wrote:
You could quickly runs into a "Sims" scenario, where you are always running around doing things to keep your bars up instead of doing what you actually want. Hmmm... kinda like real life :(
This is why it is possible in life to acquire gadgets and machinery (or hire people) to "keep the bars up" and to re-conquer time for other things. Also by prioritizing and getting rid of everything which steals time and attention away from whatever you're currently trying to do.

I personally don't have the money required to buy for example a dish washer or a washing machine and certainly don't have the kind of money to hire someone to clean my rented room but if I had that kind of money, I'd probably get these things and hire someone to clean up/cook/etc. so that I'd have time to work on this game.
(btw, I think this is exactly what is meant when people say "Time is money." because with money it's possible to "buy" free time through delegation and automation)

This is also why it will be necessary/possible to acquire gadgets and machinery in spacegame, so that you are relieved as a player from doing certain reocurring tasks (with a FremenSuit like suit upgrade, you wouldn't have to worry about dumping excess nutrition and water anymore, likewise a nutrition and liquids auto-injector upgrade would get rid of the need to eat/drink manually) and so you can advance to explore other areas of interest inside the game (I should really start referring to it as a simulation of a fictional universe, where the "game" is to explore and interact with the different bits and pieces of the simulation).

I can see how some people really would not want to spend any time preparing for a longer expedition and would much rather jump right into exploring/shooting and killing. For them, there could be different starting conditions where they already have certain equipment/upgrades so they don't need to worry about such details as remembering to eat regulary.

Gil wrote:
I do see possible cool gameplay mechanics regarding health though and maybe you already have combat related uses for health, although there is a difference between "general health" and "immediate health issues (aka injuries)".
I'm currently leaning a lot towards making spacegame more like a simulation than anything else and I'm also thinking of having a lot of random generated content and optional random starting conditions.

I think the eat/drink part could make for some very interesting survival gameplay when you start out on some remote planet in the middle of nowhere and all you have is a knife and two or three rations salvaged from your crashed landed vehicle (which would already be crashed as a part of the starting conditions).

Different types of beverages would also have different effects on other stats, for example, alcohol would temporarily have a negative effect on agility and intelligence. Repeatedly drinking alcohol over long periods of time would have permanent negative impact on the overall health stat. It could be fun to voluntarily let some crew member drink nothing but beer and try to cope with the effects while executing different tasks.

Yeah, I know, that's a lot of daydreaming up there and it will be a long, long way to go to have all of that detail in the game.

Thinking about it, the level of detail of the simulation could also serve as a guideline while developing the actual game. In the first iteration of the game, all of those deeper details could be completely left out and be introduced step by step in later iterations (and be activated as an option) as the players "possibility space" inside the simulation starts to grow and expand.
_________________
0xDB
View user's profile Send private message Visit poster's website
Reply to topic GDR Forum Index -> Game Developer's Refuge -> Development Log - Space Game Page Previous  1, 2, 3, 4, 5  Next
Game Developer's Refuge
is proudly hosted by,

HostGator

All trademarks and copyrights on this page are owned by their respective owners. All comments owned by their respective posters.
phpBB code © 2001, 2005 phpBB Group. Other message board code © Kevin Reems.