View previous topic - View next topic |
Author |
Message |
Hajo Demon Hunter
Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Mon Nov 15, 2004 8:47 am Post subject: Writing a game in two days? |
[quote] |
|
Hi,
I've been follwoing the latest constes and I'm seriously wondering how to write agme within two days.
Even my simple game projects like a "Boulder Dash" remake took weeks to create, H-World/The Jungle is now developed since almost three years and my transport sim "Simutrans" is in development since 1997, most of the time a whole team working on it. I'm used to measure my projects in years, not days.
I've spend the last weekend on a update of my space exploration game, but despite using the H-World engine and not having to code much, just editing the level maps, the item defintions, the scripts and creating some new graphics took all the time. Actually the game didn't really make prohress, it's just more polished and better tested now.
I'm really wondering how to create a full game in two days?
|
|
Back to top |
|
|
Adam Mage
Joined: 30 Dec 2002 Posts: 416 Location: Australia
|
|
Back to top |
|
|
Hajo Demon Hunter
Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Mon Nov 15, 2004 9:54 am Post subject: |
[quote] |
|
I've downloaded "The Nocturne" and tried it.
Very impressive.
Quote: |
Aim small and already have the engine done.
|
What does "already have the engine done" really mean?
I mean, what parts did you create within the 48 hours and which parts have you had premade?
|
|
Back to top |
|
|
Bjorn Demon Hunter
Joined: 29 May 2002 Posts: 1425 Location: Germany
|
Posted: Mon Nov 15, 2004 10:32 am Post subject: |
[quote] |
|
Hajo wrote: | What does "already have the engine done" really mean?
I mean, what parts did you create within the 48 hours and which parts have you had premade? |
I try to explain this almost every time this rule is used. The engine is regarded as anything but the graphics, maps, music/sfx, story and scripts. It's the code that drives the game: it handles player input, manages its resources, plays the music/sfx, draws the graphics an executes the scripts.
Now for some engines the separation between engine code and script code is vague, what exactly is meant in such cases is mostly up to the developer of the game. In my case a large part of the script code I regard as part of the engine for example, because without the basic Object, Actor, Pawn, Controller etc. classes or its sequence handling code the engine is nothing.
|
|
Back to top |
|
|
Hajo Demon Hunter
Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Mon Nov 15, 2004 10:56 am Post subject: |
[quote] |
|
This means Adam has drawn all the images and textures in 48 hours, created the maps, the dialogs, the items and other stuff?
Very impressive, indeed.
Now, back to my original question: how can you do this so fast? I mean, you're more than 10 times more effective than I am!
|
|
Back to top |
|
|
Adam Mage
Joined: 30 Dec 2002 Posts: 416 Location: Australia
|
Posted: Mon Nov 15, 2004 11:59 am Post subject: |
[quote] |
|
There was nothing too complex in what i did to make the content. The lighting and tile systems, which were originally designed to avoid the need for me to have artistic talent, made content quicker to push out and to look of a higher standard than i could otherwise do.
The tiles are very simple. I basicly made it all flat shaded, then put the static over them. Since the comp i've actually made the engine automatically add the static on loading. I used this program to generate the correct shades for the walls.
Actors are all one frame, that makes things fairly easy. And their portraits are just blown up from these. To make a new badie, i'd draw the sprite, copy to the portrait, copy a previous badie stats file and screw with the values.
Maps were made with Tiled. Actors, lights and doors were dropped in from a text file. Eg.
Code: | StaticLight,9,5,255,255,0,60,70
Door,10,6,4,2,3
Badie,7,7,GlowWorm |
The best idea is to finish a small game instead of not finishing a big one. Even if they both have the same ammount of content the finished game will be better. Ninja'd isn't really finished, but once i started running out of time i threw in the ending to give some kind of closure.
So i guess the way i did it was to think lazy. _________________ https://numbatlogic.com
|
|
Back to top |
|
|
Hajo Demon Hunter
Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Mon Nov 15, 2004 1:08 pm Post subject: |
[quote] |
|
Thank you for your answer.
I'm still a bit confused.
Let me ask a new question:
When working on a bigger game project, what do you do to get along swiftly?
|
|
Back to top |
|
|
ThousandKnives Wandering Minstrel
Joined: 17 May 2003 Posts: 147 Location: Boston
|
Posted: Mon Nov 15, 2004 11:57 pm Post subject: |
[quote] |
|
I made this game in 72 hours from scratch. I had 2 teammates, who between other obligations managed maybe 3 man-days of work between them, and they only did graphics work. But even then I had to "fix" their graphics to make them work with my engine (format locations & transparency values). I worked three 16 hour days myself in order to complete it. But its still not a "complete game" - there is only one level. I did all the programming, a few graphics, and the (shitty but amusing) sound effects.
My "keys to success"
-Beforehand I familiarized myself with the code of my other games so I could get the engine up and running as fast as possible.
-I did a lot of stuff in very similiar ways to previous games I had made.
-I did not object-orient as there is a large amount of overhead involved in object-orienting your code.
-I did not do any kind of fancy error handling besides to make a note of the error in a text file and allow the program to crash.
-I hard-coded all of the enemy routines into the game.
-I hard-coded the map into the game, it is defined via an array declaration. There were only about 15 map tiles, and the double-digit tiles were "accent" tiles so I waited until the map was otherwise complete before adding them - that way I could sort of "see" the map in the declaration since all the tiles were only one digit.
-There is no script engine or whatnot, especially since it is an action game. Events are all hard-coded.
You will note that (almost) all of these are BAD PRACTICES. However, good practices ALWAYS take more time - and sometimes significantly more time. Its hard to really get lost in the amount of code you can write in just a few days. So to my thinking there is a very low return-on-investment in any strict adherance to such rules. When you are focusing on a project that MUST AND WILL be completed in 3 days, quick and dirty is the only way. Forget what you learned in school.
Here is the source code in case you are interested.
|
|
Back to top |
|
|
Rainer Deyke Demon Hunter
Joined: 05 Jun 2002 Posts: 672
|
Posted: Tue Nov 16, 2004 2:02 am Post subject: |
[quote] |
|
ThousandKnives wrote: | You will note that (almost) all of these are BAD PRACTICES. However, good practices ALWAYS take more time - and sometimes significantly more time. |
I completely disagree. A practice is "good" if it helps you reach your goal quickly. If a good practice takes longer, you're either misusing it or it is actually a bad practice. The only exception is error handling, which does slow down development but is a good practice nonetheless. Also, some practices are good for large games but bad for small games.
Let me use my own game Ghost of the Haunted Grove as an example. I wrote it for the first RPGDX 48 hour competition, and finished it well ahead of the deadline. I had already spent some time on the engine before the contest started, but not much. The entire game could have been completed in a single 48 hour period. I was the only person involved in the project. I credit my success to the following:- The game was designed small and stayed small. There were no extraneous features whatsoever. No scripting engine, no cutscenes, no sound.
- I used Python and Pygame. This made development and debugging very fast. Python, as a rule, does not crash - it throws exceptions, which are printed with stack trace if not explicitly handled.
- I used good software engineering practices. The game uses modules and classes where appropriate, and contains virtually no redundant code. This made it easy to make changes in the project throughout its life.
- I used TileStudio to create the maps and graphics, which saved me the tedium of hardcoding the maps.
I don't currently have the source code online, but I can upload it if you want.
|
|
Back to top |
|
|
ThousandKnives Wandering Minstrel
Joined: 17 May 2003 Posts: 147 Location: Boston
|
Posted: Tue Nov 16, 2004 2:31 am Post subject: |
[quote] |
|
Obviously we have a fundamental philisophical difference between us, and I respect that. But this one statement of yours really caught my attention, and I hope you can explain it for me:
Rainer Deyke wrote: | I used good software engineering practices. The game uses modules and classes where appropriate, and contains virtually no redundant code. This made it easy to make changes in the project throughout its life. |
I agree that one key to making a game quickly is avoid redundant code at all costs. And clearly doing so makes it easier to keep everything together in your head so you can "live" the code during the short period you are working.
But, two things about this:
1. This may come from a lack of understand of python. Using modules and classes in C++ (which I code in) requires pretty much by definition the use of redundant code. There's no getting around the fact that declaring a variable and then adding at least 2 functions to set and get the value of that variable takes a lot more time and code that simply declaring the variable and doing with it what you will.
2. "throughout its life"? What life? I thought we were talking about a game made in 48 hours? What kind of "life" is that? So you come back to a certain segment of code 6 hours after you wrote it and already you can't remember anything about how it works?
Again, this is why I happen to believe quick n' dirty works in competitions, you have such a short time to work in that you can mentally "live" in the code. I found during coding that I was 100% aware of where every piece of code was and what it did and when/how it needed to change as I went along. I didn't need organizational tools such as classes and modules to assist my thinking. The only other purposes that classes and modules serve are to assist in large-scale project with multiple programmers, and to make software more adaptable to changes as they come along. My counterpoint for the latter being that within such a short time period if you find yourself needing to make such drastic changes that you are glad you used classes, you are already out of time. You really need to be planning ahead of time and ensure yourself that there will be no big changes, only tweaks.
I don't deny that your method worked- I've played "ghost of the haunted grave" and it is one of the better competition games I have played. I guess I just have a different style.
|
|
Back to top |
|
|
Nephilim Mage
Joined: 20 Jun 2002 Posts: 414
|
Posted: Tue Nov 16, 2004 6:21 am Post subject: |
[quote] |
|
Hajo wrote: | When working on a bigger game project, what do you do to get along swiftly? |
I think the number one thing you can do to keep a quick pace has nothing to do with code. When I was working on "Sacraments" for the Chloris' Call compo, I found the best tool for keeping the project moving at a fair clip was to set aside some time for some project management.
Even if you're a team of one, having some milestones in place and a clear idea what needs to be done by those milestones goes a long way. It helps keep your momentum up (by having achievable goals), it keeps morale high (because you have successes, rather than a long slog), forces you to reconsider "black hole" features, prompts you to think ahead and have a good plan for proceeding, and keeps you focused on the task at hand.
If you're interested, I expound a bit on this in my postmortem for Sacraments.
|
|
Back to top |
|
|
Rainer Deyke Demon Hunter
Joined: 05 Jun 2002 Posts: 672
|
Posted: Tue Nov 16, 2004 6:38 am Post subject: |
[quote] |
|
ThousandKnives wrote: | 1. This may come from a lack of understand of python. Using modules and classes in C++ (which I code in) requires pretty much by definition the use of redundant code. There's no getting around the fact that declaring a variable and then adding at least 2 functions to set and get the value of that variable takes a lot more time and code that simply declaring the variable and doing with it what you will. |
C++ is a very verbose language, but using classes in C++ doesn't require redundancy per se. Using getter/setter functions is rarely a good practice in the first place. The whole point of access restriction is that clients of a class can't access a variable. If you provide getter/setter functions, you defeat that purpose, so you might as well make the variable public. In those cases where getter/setter functions are appropriate - for example, if you want to guard against invalid values - they are just as appropriate for large and small projects, and just as important for procedural and object-oriented code. It's a couple of lines of code which take less than a minute to write - just do it, if you feel it's a good idea. It won't keep you from completing the game by the deadline.
In Python, things are somewhat different: there are no access restrictions, so all variables are effectively public.
Quote: | 2. "throughout its life"? What life? I thought we were talking about a game made in 48 hours? What kind of "life" is that? So you come back to a certain segment of code 6 hours after you wrote it and already you can't remember anything about how it works? |
It's not a question of remembering, it's a question of how many lines of code you need to touch to make some change.
Quote: | I didn't need organizational tools such as classes and modules to assist my thinking. The only other purposes that classes and modules serve are to assist in large-scale project with multiple programmers, and to make software more adaptable to changes as they come along. |
Actually, I don't think of classes as an organizational tool so much as a vehicle for inheritance and polymorphism. Sample code from the game:
Code: | class Goblin(Monster):
pic = get_pic(0, 1)
attack = 1
defense = 0
hp = 5
name = 'goblin'
xp = 2
gp = 1
class GoblinWarrior(Goblin):
pic = get_pic(1, 1)
xp = 4
gp = 3
name = 'goblin warrior'
attack = 2
hp = 10
class GoblinElite(GoblinWarrior):
pic = get_pic(2, 1)
xp = 8
gp = 5
name = 'goblin elite'
attack = 3
|
Note how the goblin warrior inherits the defense attribute from the normal goblin, which in turns inherits from the generic Monster class. In this way I was able to create each monster by starting with a prototype monster and customizing it to fit my needs. Each monster class only needs to define how it differs from its prototype. This means that I can add a new attribute to the base class without updating every single individual monster.
|
|
Back to top |
|
|
Hajo Demon Hunter
Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Tue Nov 16, 2004 8:33 am Post subject: |
[quote] |
|
ThousandKnives wrote: | 2. "throughout its life"? What life? I thought we were talking about a game made in 48 hours? What kind of "life" is that? So you come back to a certain segment of code 6 hours after you wrote it and already you can't remember anything about how it works?
|
I've been asking how it's possible to create a game within two day, right. But waht I had in mind are my own projects which tend to last years. I wanted to learn how to do them faster.
I don't want to make the projects smaller. I want to get done more in less time.
Solutions that create unmaintainable code are not interesting for me. I'm looking for methods to do things more efficiently. Paint faster, code faster, make less mistakes.
E.g. I spend 5 hours to code UI skinning support and create UI skins fro three game modules. What a waste of time! I didn't add a single feature to any of the modules, they just looks a bit nicer now.
Could I have done it faster? I don't know, I tried to do it as fast as I can.
Was it neccesary? Regarding to feedback that I got, it was.
http://www.simugraph.com/misc/new_skin.png
Last edited by Hajo on Tue Nov 16, 2004 9:55 am; edited 1 time in total
|
|
Back to top |
|
|
Hajo Demon Hunter
Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Tue Nov 16, 2004 8:40 am Post subject: |
[quote] |
|
Rainer Deyke wrote: |
Note how the goblin warrior inherits the defense attribute from the normal goblin, which in turns inherits from the generic Monster class. In this way I was able to create each monster by starting with a prototype monster and customizing it to fit my needs. Each monster class only needs to define how it differs from its prototype. This means that I can add a new attribute to the base class without updating every single individual monster. |
I'm using inheritance for my monster and item descriptions, too.
Inside the engine, the structure is a bit different, I prefer to have one clas that stores data in a generic way, and off-load behaviour into a actor/action system where inheritanace is used to derive new actions from basic actions.
|
|
Back to top |
|
|
Hajo Demon Hunter
Joined: 30 Sep 2003 Posts: 779 Location: Between chair and keyboard.
|
Posted: Tue Nov 16, 2004 8:42 am Post subject: |
[quote] |
|
Nephilim wrote: |
Even if you're a team of one, having some milestones in place and a clear idea what needs to be done by those milestones goes a long way. It helps keep your momentum up (by having achievable goals), it keeps morale high (because you have successes, rather than a long slog), forces you to reconsider "black hole" features, prompts you to think ahead and have a good plan for proceeding, and keeps you focused on the task at hand.
|
I've usually got a plan. Sometimes like this:
http://www.simugraph.com/forum/viewtopic.php?id=9&t_id=54
And sometimes a more blurry vision like this:
http://h-world.simugraph.com/space/data/space.txt
I'm keeping track of progress:
http://h-world.simugraph.com/news.html
How can I improve this?
|
|
Back to top |
|
|
|
Page 1 of 2 |
All times are GMT Goto page 1, 2 Next
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|