Log in

View Full Version : Batch Based Game


PerpetualImperfexion
October 6th, 2012, 07:14 PM
Epic Creature Experience (ALPHA 1.0)
Ok, first of all I would just like to let you guys know that the title is NOT permanent. It is a temporary name and I would very much appreciate your suggestions. Secondly, this game is the first version of the game. Expect small bugs, but I think I got rid of most of the big ones. If you encounter any bugs please post them here. Thirdly this game is no where near its full potential or where I want it to be. There will be many neat features added to this game in the future. So now onto the information.

The game has 583 lines in it. I've spent the last week coding the rough draft, working out the concept quirks, but it's only taken me the last 4 hours to put together the final /alpha/ draft of the game. I only started seriously studying batch a week or two ago, so this is my first major work and I am very proud of it. So without any further ado, here is the pastebin link, a few screenies, and the intro code.

Pastebin Link: http://pastebin.com/VQxF5pxz

Change Log
- In fight screen it was not displaying your attack/defense (Fixed)
- Shortened save code
- Creates/loads save in directory the batch file exists in. (Will need to move text file to where ever the the batch file is)

Intro/Explanation

:intro
cls
echo The goal of this game is to get your creature to the highest level possible.
pause
cls
echo Each time you move up a level, you gain a skillpoint.
pause >nul
cls
echo Skillpoints can be used to increase your creatures abilities.
pause >nul
cls
echo You can level your creature by feeding it food.
pause >nul
cls
echo Food can be bought at the market with money.
pause >nul
cls
echo Money can be obtained by attacking other creatures.
pause >nul
cls
echo When you attack other creatures, you lose health.
pause >nul
cls
echo To regain your health you must heal your creature by feeding it 10 food.
pause >nul
cls
echo What would you like to name your creature?
set /p name=
echo name=%name% >> C:\Users\%username%\Documents\EXI\%save%.txt
cls
echo %name% is a wonderful name for such a wonderful creature! Long live %name%!
echo.
echo Press any key to start the game...
pause >nul
goto mainmenu


New Save/Load Save Screen
http://i.imgur.com/oDGC1.png
Main Menu
http://i.imgur.com/PRpDb.png
Market
http://i.imgur.com/HrsUf.png

So if you could reply with what you think that would be great. Thanks for your time. :)

ManyPearTree
October 6th, 2012, 07:21 PM
I hated .bat coding in my IT class. I would have others like you do it for me xD. I'll try it out!

I get stuck here.

http://imageshack.us/a/img821/885/asssssssi.jpg

Please don't double post -- use the "Edit" or "Multi-quote" buttons to add something. ~TheMatrix

PerpetualImperfexion
October 6th, 2012, 07:34 PM
I get stuck here.

image (http://imageshack.us/a/img821/885/asssssssi.jpg)

When you "Press any key to return to the visit menu" does it not take you there?

ManyPearTree
October 6th, 2012, 08:48 PM
No it flashes some text (too fast to read, all i could make out was food:0) when I hit a key and goes right back to that screen.

TheMatrix
October 7th, 2012, 12:04 AM
Good heavens! Why on earth would you do that to yourself!?
Consider, in the future, using a more practical language such as C, Perl, or anything besides Batch(but don't try assembly, nobody simply types any program in a reasonable amount of time in that).

I'd write it in Perl, but I don't feel like it right now. I do, however, have some tips.

Look at line 102 and tell me what you think is wrong.
There are no comments. Comments and documentation, although it may seem unneeded and too time-taking, will prove to be essential in maintenance. It doesn't really matter what you're writing if it's over a few lines long, you should get in the habit of adding them.
Try to make your variables' names meaningful to you and others. It will help in the long run.
When writing programs that you would like more people than only Windows users to be able to use, consider using a general-purpose scripting language.
Did you really use a random number generator to determine the outcome of a "fight"? Well, I guess that's the extent of Batch's ability.

Do not think of Batch as a programming language -- it's not. All it does is exactly what the name implies: execute commands in batch amounts. The Unix shells are not programming languages, either, although arguably you can do a lot more with them.

Nice job, though.

Mirage
November 14th, 2012, 01:22 AM
I am a batch god and have been writing fluently in batch for about 5 years now. Your program is fantastic but I don't think there is a way to solve your problem. Sometimes even if your code is right batch will just not like the configuration and will refuse to work. I has pissed me off countless times, but I still wish you good luck.