Putting the 'role' back in role-playing games since 2002.
Donate to Codex
Good Old Games
  • Welcome to rpgcodex.net, a site dedicated to discussing computer based role-playing games in a free and open fashion. We're less strict than other forums, but please refer to the rules.

    "This message is awaiting moderator approval": All new users must pass through our moderation queue before they will be able to post normally. Until your account has "passed" your posts will only be visible to yourself (and moderators) until they are approved. Give us a week to get around to approving / deleting / ignoring your mundane opinion on crap before hassling us about it. Once you have passed the moderation period (think of it as a test), you will be able to post normally, just like all the other retards.

"The Legend of Beryl Reichardt" New Vintage CRPG

Opry99er

Novice
Joined
Jun 28, 2010
Messages
23
okay--- here's the skeleton for the battle engine... You can play it on Classic99 emulator, but it's not done. This is the Extended BASIC dialect... i use this language for quick and dirty mockups. Since it's BASIC, anyone can understand what is going on here. I start by initializing the variables I'll be using. Then I draw the screen and wait for user input. The lines of code I want to discuss here are lines 1000 and 2000 specifically. This is the determination of how much damage you do to your enemy, for ATTACK (line 1000) and MAGIC (line 2000). The "chance" of hitting the enemy is not in this sample code--- for the time being, I'm concerned with the ATTACK action. Here are the variables I'm tracking for each character:

LEV---Level
MHP--Max HP (Health points)
HP----HP
MMP--Max MP (Magic points)
MP---MP
A----Attack
D----Defend
MA--Magic Attack
MD--Magic Defend

I will probably track a few more variables as I get deeper into the code. For the time being, I need some help developing a good algorithm for the amount of damage done to the enemy. Lines 1000 (attack) and 2000 (magic) are the ones I'm concerned with now. Please take a look and lend me your brilliance. =)

Code:
REM **THESE ARE THE STATISTICAL VARIABLES FOR THE PC'S
REM **MAX HP, HP, MAX MP, MP, ATTACK, DEFEND, MACIC ATTACK ,MAGIC DEFEND, DAMAGE INFLICTED ON TURN
REM ** B=BERYL, R=REPTOSLICER, M=MARKUS, S=SKYLAR
REM ** SK=SKELETON (THE ENEMY)

1 BLEV=10 :: BMHP=100 :: BHP=100 :: BMMP=50 :: BMP=50 :: BA=7 :: BD=7 :: BMA=4 :: BMD=6 :: BDAM=0
2 RLEV=11 :: RMHP=100 :: RHP=100 :: RMMP=100 :: RMP=100 :: RA=5 :: RD=5 :: RMA= 8:: RMD=10 :: RDAM=0
3 MLEV=7 :: MMHP=100 :: MHP=100 :: MMMP=40 :: MMP=40 :: MA=5 :: MD=5 :: MMA=3 :: MMD=5 :: MDAM=0
4 SLEV=5 :: SMHP=100 :: SHP=100 :: SMMP=50 :: SMP=50 :: SA=4 :: SD=4 :: SMA=3 :: SMD=6 :: SDAM=0
5 CHAR$="BERYL" :: BMOV=0 :: RMOV=0 :: MMOV=0 :: SMOV=0 :: COUNT=1 :: PDAM=0
6 BMOV$="" :: RMOV$="" :: MMOV$="" :: SMOV$=""

REM **THESE ARE THE STATISTICAL VARIABLES FOR SKELETON

7 SKMHP=500 :: SKHP=500 :: SKMP=100 ::SKMMP=100 :: SKMP=100 :: SKA=5 :: SKD=5 :: SKMA=5 :: SKMD=5 :: SKDAM=0

REM **DISPLAY HP ONSCREEN

100 CALL CLEAR :: CALL SCREEN(13)
110 DISPLAY AT(2,8):"BATTLE TEST";
120 DISPLAY AT(3,1):"BERYL HP";
130 DISPLAY AT(3,18):BHP
140 DISPLAY AT(4,1):"REPTOSLICER HP";
150 DISPLAY AT(4,18):RHP
160 DISPLAY AT(5,1):"MARKUS HP";
170 DISPLAY AT(5,18):MHP
180 DISPLAY AT(6,1):"SKYLAR HP";
190 DISPLAY AT(6,18):SHP
191 DISPLAY AT(12,1):"SKELETON HP";
192 DISPLAY AT(12,18):SKHP
200 DISPLAY AT(19,1):"YOUR TURN:"
210 DISPLAY AT(21,1):"A=ATTACK  M=MAGIC  D=DEFEND"

REM **START BATTLE SEQUENCE

300 IF COUNT>4 THEN GOSUB 5000
305 IF COUNT=1 THEN CHAR$="BERYL"
306 IF COUNT=2 THEN CHAR$="REPTOSLICER"
307 IF COUNT=3 THEN CHAR$="MARKUS" 
308 IF COUNT=4 THEN CHAR$="SKYLAR"
309 DISPLAY AT(20,1):CHAR$

REM ** TIGHT LOOP

310 CALL KEY(0,K,S)
315 IF S=0 THEN 300
320 IF K=65 THEN GOSUB 1000
321 IF K=77 THEN GOSUB 2000
322 IF K=68 THEN GOSUB 3000
330 GOTO 300

REM ** ATTACK IS SELECTED, THIS DETERMINES WHAT DAMAGE YOU INFLICT

1000 IF COUNT=1 THEN BMOV=(BA+BLEV)*2
1001 IF COUNT=2 THEN RMOV=(RA+RLEV)*2
1002 IF COUNT=3 THEN MMOV=(MA+MLEV)*2
1004 IF COUNT=4 THEN SMOV=(SA+SLEV)*2
1005 IF COUNT=1 THEN BMOV$="ATTACK" 
1006 IF COUNT=2 THEN RMOV$="ATTACK"
1007 IF COUNT=3 THEN MMOV$="ATTACK"
1008 IF COUNT=4 THEN SMOV$="ATTACK"
1009 COUNT=COUNT+1
1020 RETURN

REM **MAGIC IS SELECTED, THIS DETERMINES WHAT DAMAGE YOU INFLICT

2000 IF COUNT=1 THEN BMOV=(BMA+BLEV)*2
2001 IF COUNT=2 THEN RMOV=(RMA+RLEV)*2
2002 IF COUNT=3 THEN MMOV=(MMA+MLEV)*2
2004 IF COUNT=4 THEN SMOV=(SMA+SLEV)*2
2005 IF COUNT=1 THEN BMOV$="MAGIC"
2006 IF COUNT=2 THEN RMOV$="MAGIC"
2007 IF COUNT=3 THEN MMOV$="MAGIC"
2008 IF COUNT=4 THEN SMOV$="MAGIC"
2009 COUNT=COUNT+1

2020 RETURN

REM **DEFEND IS SELECTED, THIS DETERMINES YOUR "DEFEND" VARIABLE VALUE

3000 IF COUNT=1 THEN BMOV=(BD+BLEV)*-2
3001 IF COUNT=2 THEN RMOV=(RD+RLEV)*-2
3002 IF COUNT=3 THEN MMOV=(MD+MLEV)*-2
3004 IF COUNT=4 THEN SMOV=(SD+SLEV)*-2
3005 IF COUNT=1 THEN BMOV$="DEFEND"
3006 IF COUNT=2 THEN RMOV$="DEFEND"
3007 IF COUNT=3 THEN MMOV$="DEFEND"
3008 IF COUNT=4 THEN SMOV$="DEFEND"
3009 COUNT=COUNT+1
3020 RETURN

REM **ALL PLAYERS HAVE SELECTED THEIR MOVE---THIS SHOWS RESULTS OF YOUR TURN
REM **THEN CHECKS FOR SKELETON'S "ALIVE OR DEAD", THEN GOES TO THE BEGINNING FOR THE NEXT TURN

5000 DISPLAY AT(15,1):"BERYL"
5010 DISPLAY AT(15,14):BMOV$;
5020 FOR I=1 TO 800 :: NEXT I
5030 DISPLAY AT(15,1):"REPTOSLICER"
5040 DISPLAY AT(15,14):RMOV$;
5050 FOR I=1 TO 800 :: NEXT I
5060 DISPLAY AT(15,1):"MARKUS"
5070 DISPLAY AT(15,14):MMOV$;
5080 FOR I=1 TO 800 :: NEXT I
5090 DISPLAY AT(15,1):"SKYLAR"
6000 DISPLAY AT(15,14):SMOV$;
6009 FOR I=1 TO 800 :: NEXT I
6010 PDAM=BMOV+RMOV+MMOV+SMOV
6012 DISPLAY AT(14,5):"TOTAL DAMAGE"
6013 DISPLAY AT(14,20):PDAM
6015 FOR I=1 TO 800 :: NEXT I
6016 SKHP=SKHP-PDAM
6017 IF SKHP<0 THEN GOSUB 10000
6020 COUNT=1 :: GOTO 100

REM **SKELETON IS DEAD, END THE SIMULATION

10000 CALL CLEAR :: PRINT "SKELETON DEAD" :: FOR I=1 TO 800 :: NEXT I :: END
 

Zed

Codex Staff
Patron
Staff Member
Joined
Oct 21, 2002
Messages
17,068
Codex USB, 2014
Looks pretty nice, this.

I'd personally go with the bottom, center-right black helmet. But without the feather.
 

Opry99er

Novice
Joined
Jun 28, 2010
Messages
23
Thanks... I like that one as well... It was my first choice-- but I kind of liked the feather. =) I'll take it under consideration. Thank you for taking a look!
 

Elzair

Cipher
Joined
Apr 7, 2009
Messages
2,254
Make the viewport bigger! There is a lot of wasted space!
 

Opry99er

Novice
Joined
Jun 28, 2010
Messages
23
Are you referring to the battle screen I posted? If so, I agree, in that pic, it looks like alot of wasted space---- however, when one of the menu items is selected, sometimes the text box needs to cover the entire bottom part of the screen.... Any expansion of the viewport may cause me to lose the space I need.... However, this is assemble language, and fast as hell--- so I could re-update the whole screen every 10 frames or so, even if nothing is happening. That would allow me to cover up the whole screen (if I need to) with the necessary box, and just re-build it when it's done.... It's an interesting thought.... thanks for commenting. :)y original battle screens were full screen (see first post on this thread). :)
 

shihonage

Subscribe to my OnlyFans
Patron
Joined
Jan 10, 2008
Messages
7,163
Location
location, location
Bubbles In Memoria
Ah, BASIC. Nostalgia.

FOR I=1 TO 800 :: NEXT I

Using loops for delay... haven't seen that in a while.

Not to be a jerk, but I see all these self-imposed limitations (no matter how much you justify them) as counterproductive to your growth as a game programmer.

One more jerky thing - I don't think limiting yourself to an early BASIC dialect and assembly will allow you to actually finish this.

Because

a) writing "mock up code" in BASIC and then "real code" in assembly is time consuming/inefficient.

b) inherent limitations of the languages themselves, in regards to organizing and compartmentalizing code, as compared to requirements imposed by the scope of the project. In other words, you'll get lost in your code.

Please realize, I'm not saying this to hurt you. I am sick of seeing abandoned projects that always start with "great enthusiasm", and I want you to finish your game - but I don't see it happening while you're doing this with a blindfold and your wrists tied behind your back.
 

Opry99er

Novice
Joined
Jun 28, 2010
Messages
23
No offense taken. I appreciate your candor and comments. Healthy criticism is what makes this stuff fun. As I stated previously, I have thought about this matter extensively--- and keep coming back to the same conlusions... I need to finish this TI version because it is so engrained in that environment already. I have the skeletons for these routines in assembly already, but showing assembly code (especially TMS9900) isn't very obvious what I'm trying to do. BASIC is a universally understandable language, so I chose that to show my examples. I will most certainly port this to Java or something of the like when it is complete--- absolutely. I have many expert TMS9900 coders who are actively helping with certain elements of implementation--- call them teachers. I love the TI community and I have my programming roots there. Honestly, I don't know any other languages--- modern or otherwise. If I knew a modem language, we might be having a totally different conversation--- but I understand the 9900 CPU and I'm developing an understanding for the 9918 VDP... It's just a matter of familiarity, and many great games have been written for the /4a. One in development now is called "Realms of Antiquity" and it's an Ultima-style RPG... Very slick. Tunnels of Doom, a dungeon crawler...

I know it can be done, and I'm making solid progress as I go... Check out the YouTube link in my first post. It's the scroll routine in 100% assembly. The character representation is a place-filler, but you getthe idea.

I value your opinion, and I respect your ideas--- hell, I agree with you... But I've always wanted to do this RPG on the TI, and I'm doing quite well--- IMHO. Now--- if someone wanted to help me do it in Java or C or something, I already have a hell of a development document going and a large chunk of graphics done... :). It's a great debate--- but part of "why" I want to do this is the fact that it's on the TI... It drives me... But once more--- I ABSOLUTELY want to port this to a modern language as soon as it's done. :)
 

Opry99er

Novice
Joined
Jun 28, 2010
Messages
23
Just to put this in perspective... here is my development environment.... I sh** you not

74937c18.jpg
 

As an Amazon Associate, rpgcodex.net earns from qualifying purchases.
Back
Top Bottom