# 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.

## Recommended Posts

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

##### 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,

##### 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 on other sites

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.

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

##### 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..

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

##### Share on other sites
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 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 80flag1 noMovecompare abs nearestFoodX abs nearestFoodYflag1 MoveOnXflag0 KeepWalkingflagNeg1 MoveOnYMoveOnXcompare nearestFoodX 0flag1 mRflag0 KeepWalkingflagNeg1 mLMoveOnYcompare nearestFoodY 0flag1 mUflag0 KeepWalkingflagNeg1 mDmRmemory2 0moveRightmLmemory2 1moveLeftmUmemory2 2moveUpmDmemory2 3moveDownflagBool canMoveRightflag0 mUflagBool canMoveLeftflag0 mDflagBool canMoveUpflag0 mLflagBool canMoveDownflag0 mRKeepWalkingcompare memory2 0flag0 mRcompare memory2 1flag0 mLcompare memory2 2flag0 mUcompare memory2 3flag0 mDmR

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 nearestFoodYflag1 MoveOnXflag0 KeepWalkingflagNeg1 MoveOnYMoveOnXcompare nearestFoodX 0flag1 mRflag0 mLflagNeg1 mLMoveOnYcompare nearestFoodY 0flag1 mUflag0 mUflagNeg1 mDmRmoveRightmLmoveLeftmUmoveUpmDmoveDownmLDcompare randomInt 0 5 0flag1 mLflag0 mDflagNeg1 mDKeepWalkingcompare currentFood 140flag1 mUcompare currentFood 80flagNeg1 mLDmoveRight

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 on other sites
Ok, here's another script I made:

compare abs nearestFoodX abs nearestFoodYflag1 MoveOnXflag0 KeepWalkingflagNeg1 MoveOnYMoveOnXcompare currentFood 90flag1 noMovecompare nearestFoodX 0flag1 mRflag0 KeepWalkingflagNeg1 mLMoveOnYcompare currentFood 90flag1 noMovecompare nearestFoodY 0flag1 mUflag0 KeepWalkingflagNeg1 mDflagBool canMoveLeftflag0 hitLeftWallflagBool canMoveRightflag0 hitRightWallflagBool canMoveUpflag0 hitTopWallflagBool canMoveDownflag0 hitBottomWallmRmemory2 0moveRightmLmemory2 1moveLeftmUmemory2 2moveUpmDmemory2 3moveDownbreedsplitKeepWalkingcompare memory2 0flag0 mRcompare memory2 1flag0 mLcompare memory2 2flag0 mUcompare memory2 3flag0 mDmRhitLeftWallgoto mUhitRightWallgoto mDhitTopWallgoto mRhitBottomWallgoto 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 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 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 0flag1 BANZAYflag0 CAWABANGAGoOncompare memory1 0flag0 Iniciatecontinuecompare memory4 5flag1 noMovecompare abs nearestFoodX abs nearestFoodYflag1 MoveOnXflag0 KeepWalkingflagNeg1 MoveOnYsplitMoveOnXcompare currentFood 60flag1 noMovecompare nearestFoodX 0flag1 mRflag0 KeepWalkingflagNeg1 mLMoveOnYcompare currentFood 60flag1 noMovecompare nearestFoodY 0flag1 mUflag0 KeepWalkingflagNeg1 mDmRmemory2 0moveRightmDmemory2 1moveDownmLmemory2 2moveLeftmUmemory2 3moveUpbreedsplitKeepWalkingflagBool canMoveLeftflag0 mRUflagBool canMoveRightflag0 mLDflagBool canMoveUpflag0 mRDflagBool canMoveDownflag0 mLUcompare memory2 0flag0 mRcompare memory2 1flag0 mDcompare memory2 2flag0 mLcompare memory2 3flag0 mUcompare memory2 4flag0 mRUcompare memory2 5flag0 mRDcompare memory2 6flag0 mLUcompare memory2 7flag0 mLDmRUmemory2 4compare memory3 0flag0 moveRightflag1 moveUpmRDmemory2 5compare memory3 0flag0 moveRightflag1 moveDownmLUmemory2 6compare memory3 0flag0 moveLeftflag1 moveUpmLDmemory2 7compare memory3 0flag0 moveLeftflag1 moveDownIniciatememory1 1memory2 randomInt 0 3memory4 randomInt 0 5goto continueBANZAYmemory3 0goto GoOnCAWABANGAmemory3 1goto 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 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 :)

##### 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.

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 0flag1 BANZAYflag0 CAWABANGAGoOncompare memory1 0flag0 Iniciatecontinuecompare memory4 5flag1 noMovecompare abs nearestFoodX abs nearestFoodYflag1 MoveOnXflag0 KeepWalkingflagNeg1 MoveOnYsplitMoveOnXcompare currentFood 120flag1 TryRestingXcontinueXcompare nearestFoodX 0flag1 mRflag0 KeepWalkingflagNeg1 mLMoveOnYcompare currentFood 120flag1 TryRestingYcontinueYcompare nearestFoodY 0flag1 mUflag0 KeepWalkingflagNeg1 mDmRmemory2 0moveRightmDmemory2 1moveDownmLmemory2 2moveLeftmUmemory2 3moveUpbreedsplitKeepWalkingflagBool canMoveLeftflag0 mRUflagBool canMoveRightflag0 mLDflagBool canMoveUpflag0 mRDflagBool canMoveDownflag0 mLUcompare memory2 0flag0 mRcompare memory2 1flag0 mDcompare memory2 2flag0 mLcompare memory2 3flag0 mUcompare memory2 4flag0 mRUcompare memory2 5flag0 mRDcompare memory2 6flag0 mLUcompare memory2 7flag0 mLDmRUmemory2 4compare memory3 0flag0 moveRightflag1 moveUpmRDmemory2 5compare memory3 0flag0 moveRightflag1 moveDownmLUmemory2 6compare memory3 0flag0 moveLeftflag1 moveUpmLDmemory2 7compare memory3 0flag0 moveLeftflag1 moveDownIniciatememory1 1memory2 randomInt 0 3memory4 randomInt 0 5goto continueBANZAYmemory3 0goto GoOnCAWABANGAmemory3 1goto GoOnTryRestingXcompare abs nearestFoodX 10flagNeg1 noMovegoto continueXTryRestingYcompare abs nearestFoodY 10flagNeg1 noMovegoto continueY

##### 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 on other sites
Very nice. Can't really think of any suggestions (it's already so good! =)).