• Advertisement
Sign in to follow this  

My first serious attempt at a good game.

This topic is 4239 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. I've been working on a game that I call Intelligent Design for quite a while. I would appreciate comments, suggestions, etc. on the game. The link is at the bottom of my post. Here is a screenshot of the game screen.. Screenshot Your goal is to write a script for little organisms (the blue/red dots) to follow. The green dots are food. The organisms fade from blue to red as they get 'hungrier', and if they don't find any food before they've become fully red, they 'die'. The game starts out with lots of food, a reasonably simple script is plenty to keep them alive until the timer (the red bar at the top of the screenshot) runs out, in which case you win. You also win if the total amount of food held by the organisms is 5x greater than when the level starts, but that is unlikely to happen (it is mainly so that if a good script is run on an easy level, it quickly ends instead of having to wait for the timer.) The game gets progrssively more difficult by reducing the amount of food in the map, so it forces you to write a better script. Read the in-game help files to learn how to write the scripts. Please let me know if you like it, hate it, find a bug, etc. And also, please tell me if it doesn't work. I have only been able to test it on my computer so far. And here's the link! Intelligent Design P.S. The game is not finished yet, just at a playable state. I wanted to get feedback before I continue, so that I know what to work on. One main problem is infinate loops. If you write an infinate loop into your script, it currently does not detect it, so be careful. Kill the process if you must. Run intelligent_design.exe, and write your script in the textbox on the right side of the screen. The program is in 1024x768, so if you don't want the screen to have to keep changing resolutions, you might want to set your resolution to 32 bit color, 1024 x 768. Again, this game is still rough around the edges, so let me know if you find anything wrong with it it particular.

Share this post


Link to post
Share on other sites
Advertisement
Couldn't run it: Didn't have MSVCRTD.dll. Did you distribute a debug version?

Share this post


Link to post
Share on other sites
Ah.. Thanks. I did distribute a debug version. I'm not sure if I fixed it in the project settings, so I put the appropriate dll in the zip along with the other files..

The .NET 2.0 framework is required, by the way, for the visual basic portion of the program. intelligent_design.exe was produced in visual basic 2005 express, and life.exe, which is the actual game portion, was produced in c++, using SDL.

Please try it out and let me know if it works now.

Thanks,
Adam

Share this post


Link to post
Share on other sites
[A somewhat late response]
I've tried out the game now, I've loaded "Load_This.lsc" and previewed it, and I must say that it looks interesting. Only problem is, about 15-30 secs after I start the game (it's the same amount of time each time, around 1/4 of the red bar has disappeared), the fullscreen "life" simply shuts down, and I do not know what it's doing...

Tips on the scripts:
For sets of variables, try and use an array-style syntax, such as "()" or "[]" to enclose the number, example: "flag[0]" or "memory[2]". Also, instead of something like "flagNeg1", try "flagEquals[-1]", or "flagEq(-1)". As for defining flag operations, try making it require a colon ":" so it isn't as confusing, or something to make it pop out a little more.
I didn't exactly go through all of the scripting, just skimmed it a little...
With the form, I would suggest keeping it with a standard Windows style (border, window bar, background color), and allow (Ctrl+A) "Select All" in the text boxes.

Share this post


Link to post
Share on other sites
Thanks for the comments.

The program ending early is something I put in on purpose to keep the game from getting too slow. If the combined health of all of the organisms exceeds a certain value, it automatically shuts down. There is a level system, and load_this.lsc is one of the best scripts I've written, so usually without having my example script, you'd be using a fairly bad one in the earlier levels anyway. I think I'll add some text that says "You've won" or "You've lost" for a few seconds to make it clearer that that was intended.

The idea is that you have to keep refining your script to advance to higher levels.


I had to write the scripting system myself, so I made it as simple for me as possible. I'm not really capable of writing anything much for advanced than the current system.

Thanks for the comments, I'll certainly revise my program a bit.

Adam

Share this post


Link to post
Share on other sites
I can't load the mscorees.dll apparently, so no feedback from me, sorry.

Share this post


Link to post
Share on other sites
Chances are you don't have the .NET frameowrk installed. .NET framework 2.0 is required to run this.

Here is a link to the download site of the x86 (Intel processor) version of the .NET framework. If you don't have an intel processor, you can just google .net framework..

.NET Framework download.


The .NET framework is required for the VB.net express portion of my program.

It is 22.4 mb in size, so if you don't feel like downloading it / installing it on your comptuer, please don't feel obligated to do so. If you are curious about my program and don't mind, then the download is available to you.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You know, this was pretty impressive. I just found the script to be a little complicated to use... (maybe because I don't know asembly, tought).

Once I tought about doing something very similar to this... it would be actually a game were you had lots of units, and each one of them had a script controling their actions! So they moved around the world, trying to eat and reproduce. Well, I imagine that having this idea is pretty simple, the actual complicated part is coding it :). Anyway, but one of my ideas was that, for each line of script that the particle read, they would loose one unit of food. This way, the simpler your script was, the more successfull it would be. I imagine you have your own plans about the developlment of your game, but oh well, these are my 2 cents...

Anyway, I tought this was awesome, so please keep us informed as things evolve over there!

Share this post


Link to post
Share on other sites
Did I say the script was too hard? Well, your help file was very good! Anyway, here's the best script I got:


compare currentFood 80
flag1 noMove
compare abs nearestFoodX abs nearestFoodY
flag1 MoveOnX
flag0 KeepWalking
flagNeg1 MoveOnY

MoveOnX
compare nearestFoodX 0
flag1 mR
flag0 KeepWalking
flagNeg1 mL

MoveOnY
compare nearestFoodY 0
flag1 mU
flag0 KeepWalking
flagNeg1 mD

mR
memory2 0
moveRight

mL
memory2 1
moveLeft

mU
memory2 2
moveUp

mD
memory2 3
moveDown

flagBool canMoveRight
flag0 mU

flagBool canMoveLeft
flag0 mD

flagBool canMoveUp
flag0 mL

flagBool canMoveDown
flag0 mR

KeepWalking
compare memory2 0
flag0 mR
compare memory2 1
flag0 mL
compare memory2 2
flag0 mU
compare memory2 3
flag0 mD

mR





Problem with this script is that the colision part doesen't work... I don't understand what I'm doing wrong.

But the one I really liked was this one: I build it before I understood how memory management worked, do he doesen't store any information :) Still, it managed to go as far as level 15


compare abs nearestFoodX abs nearestFoodY
flag1 MoveOnX
flag0 KeepWalking
flagNeg1 MoveOnY

MoveOnX
compare nearestFoodX 0
flag1 mR
flag0 mL
flagNeg1 mL

MoveOnY
compare nearestFoodY 0
flag1 mU
flag0 mU
flagNeg1 mD

mR
moveRight

mL
moveLeft

mU
moveUp

mD
moveDown

mLD
compare randomInt 0 5 0
flag1 mL
flag0 mD
flagNeg1 mD

KeepWalking
compare currentFood 140
flag1 mU
compare currentFood 80
flagNeg1 mLD
moveRight





By the way, I was the above anonymous. Also: the variable currentFood isn't listed in your command list :)

EDIT: Well, I just added the top two lines to my first script. This makes less possible to him to die in the early levels.

[Edited by - algumacoisaqualquer on July 14, 2006 9:41:25 PM]

Share this post


Link to post
Share on other sites
Ok, here's another script I made:


compare abs nearestFoodX abs nearestFoodY
flag1 MoveOnX
flag0 KeepWalking
flagNeg1 MoveOnY

MoveOnX
compare currentFood 90
flag1 noMove
compare nearestFoodX 0
flag1 mR
flag0 KeepWalking
flagNeg1 mL

MoveOnY
compare currentFood 90
flag1 noMove
compare nearestFoodY 0
flag1 mU
flag0 KeepWalking
flagNeg1 mD

flagBool canMoveLeft
flag0 hitLeftWall
flagBool canMoveRight
flag0 hitRightWall
flagBool canMoveUp
flag0 hitTopWall
flagBool canMoveDown
flag0 hitBottomWall

mR
memory2 0
moveRight

mL
memory2 1
moveLeft

mU
memory2 2
moveUp

mD
memory2 3
moveDown

breed
split

KeepWalking
compare memory2 0
flag0 mR
compare memory2 1
flag0 mL
compare memory2 2
flag0 mU
compare memory2 3
flag0 mD

mR

hitLeftWall
goto mU
hitRightWall
goto mD
hitTopWall
goto mR
hitBottomWall
goto mL


The cacth about this one is that, if there is food close to the rganism, he won't move until he is really hungry... this is quite a food saver. Like the others, the colision with the wall doesent work... in early levels, it's better to change the noMove to split, it will make the game move faster.
Another question I have: what are the initial values of memory1, 2, etc?

Share this post


Link to post
Share on other sites
I'm glad you like my game. The memory values are initially 0.

Most of your most recent script was correct, but you never tested what the memory values were. You should put something to the effect of..

compare memory2 0
flag0 mR
compare memory2 1
flag0 mL

etc, just before you define mR,mL,mU, and mD

Share this post


Link to post
Share on other sites
Actually, I tested, but it was only after I declared the mR, mL, etc. By the way, here's my newest script:


compare memory3 0
flag1 BANZAY
flag0 CAWABANGA
GoOn

compare memory1 0
flag0 Iniciate

continue
compare memory4 5
flag1 noMove

compare abs nearestFoodX abs nearestFoodY
flag1 MoveOnX
flag0 KeepWalking
flagNeg1 MoveOnY
split

MoveOnX
compare currentFood 60
flag1 noMove
compare nearestFoodX 0
flag1 mR
flag0 KeepWalking
flagNeg1 mL

MoveOnY
compare currentFood 60
flag1 noMove
compare nearestFoodY 0
flag1 mU
flag0 KeepWalking
flagNeg1 mD

mR
memory2 0
moveRight

mD
memory2 1
moveDown

mL
memory2 2
moveLeft

mU
memory2 3
moveUp

breed
split

KeepWalking

flagBool canMoveLeft
flag0 mRU
flagBool canMoveRight
flag0 mLD
flagBool canMoveUp
flag0 mRD
flagBool canMoveDown
flag0 mLU

compare memory2 0
flag0 mR
compare memory2 1
flag0 mD
compare memory2 2
flag0 mL
compare memory2 3
flag0 mU
compare memory2 4
flag0 mRU
compare memory2 5
flag0 mRD
compare memory2 6
flag0 mLU
compare memory2 7
flag0 mLD

mRU
memory2 4
compare memory3 0
flag0 moveRight
flag1 moveUp

mRD
memory2 5
compare memory3 0
flag0 moveRight
flag1 moveDown

mLU
memory2 6
compare memory3 0
flag0 moveLeft
flag1 moveUp

mLD
memory2 7
compare memory3 0
flag0 moveLeft
flag1 moveDown

Iniciate
memory1 1
memory2 randomInt 0 3
memory4 randomInt 0 5
goto continue

BANZAY
memory3 0
goto GoOn
CAWABANGA
memory3 1
goto GoOn



This one has the wall colision working! It became a lot more complicated to work with... I began to misspell my labels, etc. I also tried to make my organisms suicide so that there would be more food left for the rest of the rest of them, but it turned out that, even at level 34 (look! I made until 34... but I needed several lucky attempts), the 16 food avaliable was enought for everybody... they were just having a hard time finding it.

Share this post


Link to post
Share on other sites
Awesome :)

I'm very pleased to see that someone else can pick up on the syntax. I had hoped it wouldn't be too difficult to learn.

Thanks for doing such a thorough test of my program, I really appreciate it.

Testing your script for myself right now...

Wow, I like it a lot. One small recommendation for you - Let the organism get Very close to the piece of food before telling it to not move. If it will only take 1 or 2 frames to get to the food, it is easier to snatch the food as soon as you dip below a certain hp level. And have you looked at the stat system? You got the food at 60hp when you could have raised your maximum health a little bit.

Just some suggestions :)

I'm glad you like my "game", thanks for your comments,
Adam

Share this post


Link to post
Share on other sites
Well, thanks for the input, it worked! It needed a little teaking, so that the organisms would still stop like before, but I managed to reach to level 30 before things became a matter of luck (well, they were already starting to become... I can't really tell you the division).

About the stats.. yes, I knew about them, I actually tweaked several times if them, trying to figure out wicth ones were more important (I used to think it was food detecting and food loss rate, but hit points actually really made a diference, now that you mentioned). The numbers in the script had to me changes from time to time, but to tell the truth, I had kind of "forgoten" the 60 over there... and just kept the hit points as low as possible.

Now, about the script itself...
I don't think that it isn't really dificult, but it is really scary. It was a matter of luck (well, more about free time than luck) that, instead of giving up, I managed to build a simple 'seek the food' script. My initial script didn't dealed with memory, flagBools or random, so it was somewhat simpler. Still, I had to deal with the flag system. However, with that being said, make scripting fun is surely not an easy task, I think you got something.

Also, considering the simplicity (in a good way) of the scrip, you could even make a drag-and-drop type of interface, or things like that (with pretty icons and simple but working exemples, plus your documentation that is allready very good, I don't think it will be that hard to learn).

And one thing that I was thinking os if there is any way I can turn off the 5x limit thing on early levels (the one that level up before the timer is over)? Well, I was just curious to see those guys crowding the first level, but this might bring some problems to the program (I mean, you have to run the script once for each organism for each frame, right? that's a lot!)

Here's the recent version of the script (stoping close to the food)

compare memory3 0
flag1 BANZAY
flag0 CAWABANGA
GoOn

compare memory1 0
flag0 Iniciate

continue
compare memory4 5
flag1 noMove

compare abs nearestFoodX abs nearestFoodY
flag1 MoveOnX
flag0 KeepWalking
flagNeg1 MoveOnY
split

MoveOnX
compare currentFood 120
flag1 TryRestingX
continueX
compare nearestFoodX 0
flag1 mR
flag0 KeepWalking
flagNeg1 mL

MoveOnY
compare currentFood 120
flag1 TryRestingY
continueY
compare nearestFoodY 0
flag1 mU
flag0 KeepWalking
flagNeg1 mD

mR
memory2 0
moveRight

mD
memory2 1
moveDown

mL
memory2 2
moveLeft

mU
memory2 3
moveUp

breed
split

KeepWalking

flagBool canMoveLeft
flag0 mRU
flagBool canMoveRight
flag0 mLD
flagBool canMoveUp
flag0 mRD
flagBool canMoveDown
flag0 mLU

compare memory2 0
flag0 mR
compare memory2 1
flag0 mD
compare memory2 2
flag0 mL
compare memory2 3
flag0 mU
compare memory2 4
flag0 mRU
compare memory2 5
flag0 mRD
compare memory2 6
flag0 mLU
compare memory2 7
flag0 mLD

mRU
memory2 4
compare memory3 0
flag0 moveRight
flag1 moveUp

mRD
memory2 5
compare memory3 0
flag0 moveRight
flag1 moveDown

mLU
memory2 6
compare memory3 0
flag0 moveLeft
flag1 moveUp

mLD
memory2 7
compare memory3 0
flag0 moveLeft
flag1 moveDown

Iniciate
memory1 1
memory2 randomInt 0 3
memory4 randomInt 0 5
goto continue

BANZAY
memory3 0
goto GoOn
CAWABANGA
memory3 1
goto GoOn

TryRestingX
compare abs nearestFoodX 10
flagNeg1 noMove
goto continueX

TryRestingY
compare abs nearestFoodY 10
flagNeg1 noMove
goto continueY

Share this post


Link to post
Share on other sites
I would really recommend using an existing script language, like LUA or Python. Python will soon be a first-class .NET language, too, so that might be the way to go for you.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement