Jump to content

Photo

New 32k XB Game:ZOMBi (work in progress)

Extended Basic Game Zombies zombie platformer

199 replies to this topic

#51 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sat Aug 20, 2016 9:14 AM

I have to tell ya. In rewriting my collision detection routines I find I'm writing what feels like 10 times more code than the original code, to perform 10 times less functions than the original code.

I sure hope the performance improvements are noticeable, I'll be ready to test within the half hour or so.. 



#52 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 9,797 posts
  • Location:Hustisford, WI

Posted Sat Aug 20, 2016 10:23 AM

Hmmm.... I have not delved too deeply into the code, but if all your static characters are SPRITEs (except for holes), why not do a COINC(ALL) and branch to a subroutine that determines what was hit?

I don't know, seems the easiest way.

#53 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sat Aug 20, 2016 11:23 AM

Hmmm.... I have not delved too deeply into the code, but if all your static characters are SPRITEs (except for holes), why not do a COINC(ALL) and branch to a subroutine that determines what was hit?

I don't know, seems the easiest way.

loot (zombies, hearts, melee and ranged) are not static. Player holes and exits are. That's what I was doing before with 26 sprites to go through using all.
After reworking it I am doing a level and position check first to determine player position, once I know the position of the player, I know what sprite the player is closest to being coinc with so I just run the coinc against that sprite number and the player.

 

The new method drills straight down to the answer to perform the action based on vicinity which is maybe 3-4 checks to result a coinc where as my old method relied on for next loops against the array and checking each time - this results in 23 checks (one for exit, 8 holes, 14 loot items) before it could resolve a coinc check.

I'm not seeing a huge performance boost yet which is why I'm still combing through code.

 


Edited by Sinphaltimus, Sat Aug 20, 2016 11:24 AM.


#54 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sat Aug 20, 2016 12:56 PM

If I could only get through a day without distractions. But my GoTek Amiga Floppy Drive Emulator arrived. :) Had to fire it up and poke about.

 

OK, now back to fixing this thing I broke in my code.



#55 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Aug 22, 2016 6:26 PM

I'm taking a short break. More hardware projects hit me out of the blue and my brain needs a break from XB for a few days. No worries, I have every intention to make this a fully functioning game sooner than anyone thinks. :)


Edited by Sinphaltimus, Mon Aug 22, 2016 6:26 PM.


#56 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sat Aug 27, 2016 1:58 PM

New Version 0.30

 

GAME IS CURRENTLY EARLY ACCESS ALPHA version. No ETA on Beta.

Just copy/paste from below OR download the class99 save dsk1.ZOMBI029 file and Extended BASIC text file that is attached here:

 

zip.gif  Zombtiv30.zip   16.08KB   0 downloads

 

How To Play:

 

About: This is meant to be a semi casual zombie survival game to escape a skyscraper. Play for score (session high score coming soon)

 

Combat:  A melee attack is a swing attack that covers the space directly in front and behind the player. You get one attack per inventory item.

Joystick down = ranged attack temporarily using a noise for place holder.
 
ZEDS: Will grab you and attack you. Hold a direction to escape, try hitting with melee, break away as fast as you can. 
 
DODGE: You can attempt to dodge zeds by jumping past them (joystick button or J)

 

LOOTING: Will slow you down, jump past it to dodge the loot if you need to (for future versions when Zombies run)

 

Controls:

X=Quit, R=Reset, J and Controller Button = Jump, Joystick Left/Right moves left/right,

Joystick up = melee attack - 
 
Notes: Melee attacks will destroy loot including hearts. Be careful not to use up all your melee weapons. You can miss a melee attack,
if a zombie doesn't die after 2 hits, try re positioning.

 

V030 changes:
Can jump while running.
improved running speed.
Re-Wrote Loot distribution and collision code and then fixed everything that I broke as a result.
Fixed GUI display issue when ranged is full causing wrap around of value on the display.
looting and zombie attacks slow you down.
Added sounds for falling and loot pickup.

 

Spoiler
 
Spoiler

Edited by Sinphaltimus, Sat Aug 27, 2016 2:05 PM.


#57 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Sat Aug 27, 2016 6:15 PM

  
13882613_10206747180590105_7544198560067   
 
ZOMBi v0.32
 
 
 
GAME IS CURRENTLY EARLY ACCESS ALPHA version. No ETA on Beta.

I will update this code below to the latest version when ever announced in a new comment so you don't have to go searching.
Just copy/paste from below OR download the class99 save dsk1.ZOMBI32 file and Extended BASIC text file that is attached here:
 
Attached File  Zombti32.zip   16.17KB   3 downloads
 
How To Play:
 
About: This is meant to be a semi casual zombie survival game to escape a skyscraper. Play for score (session high score coming soon)
 
Combat:  A melee attack is a swing attack that covers the space directly in front and behind the player. You get one attack per inventory item.
Joystick down = ranged attack temporarily using a noise for place holder.
 
ZEDS: Will grab you and attack you. Hold a direction to escape, try hitting with melee, break away as fast as you can. 
 
DODGE: You can attempt to dodge zeds by jumping past them (joystick button or J)
 
LOOTING: Will slow you down, jump past it to dodge the loot if you need to (for future versions when Zombies run)
 
Controls:
X=Quit, R=Reset, J and Controller Button = Jump, Joystick Left/Right moves left/right,
Joystick up = melee attack - 
 
Notes: Melee attacks will destroy loot including hearts. Be careful not to use up all your melee weapons.
Don't mash the jump button, press and hold.
 
V032 changes:
Fixed Melee COINC issue caused by me debugging unrelated things.
Added Zombie Hit indicator (Zombie flashes red when hit)
        Added more sounds
 
To Do Next:
Create attacks for ranged including inventory changes
Replace temp zombi health with per sprite health. right now they share 2hps and it gets reset to 2 at each death.
Create basic zombie AI and animate.
session high score
 
 
KNOW ISSUES:
There are no known bugs at time of upload.
The code is bloated. A lot of fluff and stuff. I needed it this way to hunt bugs. I will optimize the code in a later version.
Not all functionality or game mechanics have been developed as of this version.
 
To Do Long Term:
Title screen.
Sounds
Music.
Session High Score
Loot balancing with board progression. (game balancing)
zombie difficulty linked to board progression.
At least 2 more types of ever more difficult zombies.
 
 

Spoiler

 
 
14046125_10206754129283818_5107071143118


Edited by Sinphaltimus, Mon Aug 29, 2016 5:28 AM.


#58 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Aug 29, 2016 5:27 AM

HA! Working on V33 and I ran out of memory! LOL, Yeah. OK, I guess I have to start optimizing now; stripping out redundant code, combining commands and command lines and removing a ton of comments no longer needed. 

This will take a while and I can only work on it after my real job so new update in a couple of days.

I've implemented the ranged weapon, you can now shoot zombies! :)



#59 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 4,139 posts

Posted Mon Aug 29, 2016 6:59 AM

... and removing a ton of comments no longer needed.


You could let a lot of comments stay in your source text-file like this:
 
! This should clear the screen
100 CALL CLEAR
! And this turns it all red
110 CALL SCREEN(7)
REM And this loops forever
120 GOTO 120
 

When you copy and paste to Classic99, Classic99 will ignore the lines beginning with the markers for remarks/comments. ! seems to be ignored quicker than REM when you use "Paste XB".

;)

Edited by sometimes99er, Mon Aug 29, 2016 12:27 PM.


#60 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Aug 29, 2016 7:08 AM

You could let a lot of comments stay in your source text-file like this:
 

! This should clear the screen
100 CALL CLEAR
! And this turns it all red
110 CALL SCREEN(7)
REM And this loops forever
120 GOTO 120
 
When you copy and paste to Classic99. Classic99 will ignore the lines beginning with the markers for remarks/comments. ! seems to be ignored quicker than REM when you use "Paste XB".

;)



Wait what?!?

If I out all my comments on their own line starting with an exclamation, Classic does not paste those lines when I chippy and paste all!?!?!?

Wow man, thank you so much for that tid bit. That will save me about 30 percent of the total code base alone.

I will be at it after work today.

Thank you thank you thank you.

#61 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 9,797 posts
  • Location:Hustisford, WI

Posted Mon Aug 29, 2016 12:21 PM

Yep, this is true. I use Notepad++ and have large blocks of rem statements between chunks of code. Just put the (!) in front of them and they do not go to memory in XB when pasted. You can see them get pasted, but they are not retained in memory, and you cannot see them when you LIST the program.

#62 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Aug 29, 2016 1:14 PM

I discovered notepad++ just 2 weeks ago when Notepad almost caused me to put my fist through my monitor.

I re-commented all my code during lunch today. I found that I have about 4k in comments.

I know I can ramble on but 4k? Damn...

#63 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 9,797 posts
  • Location:Hustisford, WI

Posted Mon Aug 29, 2016 1:19 PM

Jedi Gauntlet is about 10k right now, with 12k of comments.

Paragraphs of development comments between code segments

#64 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Aug 29, 2016 1:43 PM

The only downside I see to this method is resequencing and list "clip".

#65 Lee Stewart ONLINE  

Lee Stewart

    River Patroller

  • 3,728 posts
  • Location:Silver Run, Maryland

Posted Mon Aug 29, 2016 1:56 PM

Yep, this is true. I use Notepad++ and have large blocks of rem statements between chunks of code. Just put the (!) in front of them and they do not go to memory in XB when pasted. You can see them get pasted, but they are not retained in memory, and you cannot see them when you LIST the program.

 

I discovered notepad++ just 2 weeks ago when Notepad almost caused me to put my fist through my monitor. ...

 

Yeah, I've been using Notepad++ ever since I started converting/enhancing TI Forth into my flie-based fbForth 1.0 and cartridge-resident fbForth 2.0 more than three years ago.  It is a great programmer's editor!

 

...lee



#66 adamantyr OFFLINE  

adamantyr

    Stargunner

  • 1,349 posts

Posted Mon Aug 29, 2016 2:03 PM

Looking at your code, there is room to optimize your set-up. You are using a LOT of loops and lines to set up character patterns. Remember that Extended BASIC can define up to 4 consecutive characters at a time in a single CHAR statement, so you could structure it like this:

 

100 FOR I=1 TO 10 :: READ C,C$ :: CALL CHAR(C,C$):: NEXT I

...

! 96 - Zed, 97 - ...

10000 DATA 96,FFF...

10010 DATA 100,FFF...

 

This will reclaim a LOT of code space and let you use the comments to remind yourself which pattern is which character.



#67 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 4,139 posts

Posted Mon Aug 29, 2016 2:24 PM

The only downside I see to this method is resequencing and list "clip".


You could perhaps have a two column format in your text editor or simply use a spreadsheet.

First column has your code, - that's one line-number and program statements per line (row). Second column has you comments.

Copy first column to Classic99. Resequence and list "clip". Copy resequenced code and paste in first column. Shouldn't it line up with your old comments ?

 

;)

 

comments.png


Edited by sometimes99er, Mon Aug 29, 2016 2:30 PM.


#68 adamantyr OFFLINE  

adamantyr

    Stargunner

  • 1,349 posts

Posted Mon Aug 29, 2016 2:27 PM

For example, a small snippet of optimized pattern code:

100 SCORE=0000 :: HEALTH=10 :: BOARD=1 :: HSCORE=0 :: MELEE=0 :: RANGED=0
120 CALL SCREEN(2):: CALL COLOR(3,12,1,4,12,1,8,7,1,10,15,1,11,8,1,12,12,1,14,12,1):: HCLR=1 :: CALL CLEAR
130 FOR I=1 TO 53 :: READ C,C$ :: CALL CHAR(C,C$):: NEXT I

140 DATA 33,1818101010101018,34,1818183C1C142630,35,181A3C5E1A334060,36,18197E981C724100,37,18197E9818147243,38,1818385E581C2436
150 DATA 39,1818101010101018,40,000C1C3058081018,41,00000C1C305C1C18,42,0000060E183C0C18,43,0003070C18081018
160 DATA 64,0303040609081010,65,1818141810106000,66,1818103810180C00,67,1818503010180404
170 DATA 68,0018183050180818,69,1818101038501018
180 DATA 70,1818080808080818,71,1818183C3828640C,72,18583C7A58CC0206,73,18987E19384E8200,74,18987E1918284EC2,75,18181C7A1A38246C
190 DATA 76,1818080808080818,77,0030380C1A100818,78,000030380C3A3818,79,00006070183C3018,80,00C0E03018100818
200 DATA 81,C0C0206090100808,82,1818281808080600,83,1818081C08183000,84,18180A0C08182020
210 DATA 85,0018180C0A181018,86,181808081C0A0818
220 DATA 104,3C4426D999A5C3FF,105,FFC3A59999A5C3FF,106,FFFFFFFFFFFFFFFF,107,1F1111111D11111F,88,66FFFFFF7E7E3C18
230 DATA 96,3C2418FF9918183C,112,C0E0703A1E0C1A01,113,000000FF7F1E1606,120,70808063141414E3,121,00000000334A4A32,122,00000000993C2118
240 DATA 123,0044442810284444,124,E0E080E9EF86EFE9,44,3838107CBA38286C,45,3C3C18FF7E3C183C,46,0C0C04FC4C3C286C,47,3030203F323C1436
250 DATA 143,002418FF1824,142,0000008

860 RANDOMIZE


#69 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Aug 29, 2016 2:45 PM

You could perhaps have a two column format in your text editor or simply use a spreadsheet.

First column has your code, - that's one line-number and program statements per line (row). Second column has you comments.

Copy first column to Classic99. Resequence and list "clip". Copy resequenced code and paste in first column. Shouldn't it line up with your old comments ?

 

;)

 

comments.png

 

 

Yep, notepad++ is perfect for this. I thought about it after posting that "downside" comment.



#70 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 4,139 posts

Posted Mon Aug 29, 2016 2:47 PM

I would probably have written the lines 160-850 like this ... ;)
 

160 CALL CHAR(33,"18181010101010181818183C1C142630181A3C5E1A33406")
170 CALL CHAR(36,"18197E981C72410018197E98181472431818385E581C24361818101010101018")
180 CALL CHAR(40,"000C1C305808101800000C1C305C1C180000060E183C0C180003070C18081018")
190 CALL CHAR(44,"3838107CBA38286C3C3C18FF7E3C183C0C0C04FC4C3C286C3030203F323C1436")
200 CALL CHAR(64,"030304060908101018181418101060001818103810180C001818503010180404")
210 CALL CHAR(68,"0018183050180818181810103850101818180808080808181818183C3828640C")
220 CALL CHAR(72,"18583C7A58CC020618987E19384E820018987E1918284EC218181C7A1A38246C")
230 CALL CHAR(76,"18180808080808180030380C1A100818000030380C3A381800006070183C3018")
240 CALL CHAR(80,"00C0E03018100818C0C020609010080818182818080806001818081C08183")
250 CALL CHAR(84,"18180A0C081820200018180C0A181018181808081C0A08180")
260 CALL CHAR(88,"66FFFFFF7E7E3C18")
270 CALL CHAR(96,"3C2418FF9918183C")
280 CALL CHAR(104,"3C4426D999A5C3FFFFC3A59999A5C3FFFFFFFFFFFFFFFFFF1F1111111D11111F")
290 CALL CHAR(112,"C0E0703A1E0C1A01000000FF7F1E1606")
300 CALL CHAR(120,"70808063141414E300000000334A4A3200000000993C2118")
310 CALL CHAR(124,"E0E080E9EF86EFE9")
320 CALL CHAR(142,"0000008000000000002418FF1824")
  


#71 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Aug 29, 2016 2:49 PM

 

For example, a small snippet of optimized pattern code:

100 SCORE=0000 :: HEALTH=10 :: BOARD=1 :: HSCORE=0 :: MELEE=0 :: RANGED=0
120 CALL SCREEN(2):: CALL COLOR(3,12,1,4,12,1,8,7,1,10,15,1,11,8,1,12,12,1,14,12,1):: HCLR=1 :: CALL CLEAR
130 FOR I=1 TO 53 :: READ C,C$ :: CALL CHAR(C,C$):: NEXT I

140 DATA 33,1818101010101018,34,1818183C1C142630,35,181A3C5E1A334060,36,18197E981C724100,37,18197E9818147243,38,1818385E581C2436
150 DATA 39,1818101010101018,40,000C1C3058081018,41,00000C1C305C1C18,42,0000060E183C0C18,43,0003070C18081018
160 DATA 64,0303040609081010,65,1818141810106000,66,1818103810180C00,67,1818503010180404
170 DATA 68,0018183050180818,69,1818101038501018
180 DATA 70,1818080808080818,71,1818183C3828640C,72,18583C7A58CC0206,73,18987E19384E8200,74,18987E1918284EC2,75,18181C7A1A38246C
190 DATA 76,1818080808080818,77,0030380C1A100818,78,000030380C3A3818,79,00006070183C3018,80,00C0E03018100818
200 DATA 81,C0C0206090100808,82,1818281808080600,83,1818081C08183000,84,18180A0C08182020
210 DATA 85,0018180C0A181018,86,181808081C0A0818
220 DATA 104,3C4426D999A5C3FF,105,FFC3A59999A5C3FF,106,FFFFFFFFFFFFFFFF,107,1F1111111D11111F,88,66FFFFFF7E7E3C18
230 DATA 96,3C2418FF9918183C,112,C0E0703A1E0C1A01,113,000000FF7F1E1606,120,70808063141414E3,121,00000000334A4A32,122,00000000993C2118
240 DATA 123,0044442810284444,124,E0E080E9EF86EFE9,44,3838107CBA38286C,45,3C3C18FF7E3C183C,46,0C0C04FC4C3C286C,47,3030203F323C1436
250 DATA 143,002418FF1824,142,0000008

860 RANDOMIZE

 

 

Yes, absolutely. I wasn't counting on running out of memory this soon and was not optimizing any of my code as much as I could be.

I'm going to take care of all this right now so I know what I have left to work with as far as what I need to finish this game and/or add additional features.

 

I don't even need most of those call colors. I have them there as reference from very early on. I'm doing most of my color calls at the call sprite level.  I really left a mess behind for myself, but then again, I wasn't planning on making a game either. I was just animating a little running man is all, then all of a sudden THIS happened.



#72 adamantyr OFFLINE  

adamantyr

    Stargunner

  • 1,349 posts

Posted Mon Aug 29, 2016 2:50 PM

 

I would probably have written the lines 160-850 like this ... ;)
 

160 CALL CHAR(33,"18181010101010181818183C1C142630181A3C5E1A33406")
170 CALL CHAR(36,"18197E981C72410018197E98181472431818385E581C24361818101010101018")
180 CALL CHAR(40,"000C1C305808101800000C1C305C1C180000060E183C0C180003070C18081018")
190 CALL CHAR(44,"3838107CBA38286C3C3C18FF7E3C183C0C0C04FC4C3C286C3030203F323C1436")
200 CALL CHAR(64,"030304060908101018181418101060001818103810180C001818503010180404")
210 CALL CHAR(68,"0018183050180818181810103850101818180808080808181818183C3828640C")
220 CALL CHAR(72,"18583C7A58CC020618987E19384E820018987E1918284EC218181C7A1A38246C")
230 CALL CHAR(76,"18180808080808180030380C1A100818000030380C3A381800006070183C3018")
240 CALL CHAR(80,"00C0E03018100818C0C020609010080818182818080806001818081C08183")
250 CALL CHAR(84,"18180A0C081820200018180C0A181018181808081C0A08180")
260 CALL CHAR(88,"66FFFFFF7E7E3C18")
270 CALL CHAR(96,"3C2418FF9918183C")
280 CALL CHAR(104,"3C4426D999A5C3FFFFC3A59999A5C3FFFFFFFFFFFFFFFFFF1F1111111D11111F")
290 CALL CHAR(112,"C0E0703A1E0C1A01000000FF7F1E1606")
300 CALL CHAR(120,"70808063141414E300000000334A4A3200000000993C2118")
310 CALL CHAR(124,"E0E080E9EF86EFE9")
320 CALL CHAR(142,"0000008000000000002418FF1824")
  

That also works, although you ARE burning up bytes for every CALL CHAR there... that's why a loop is more efficient code-wise. :)



#73 Sinphaltimus OFFLINE  

Sinphaltimus

    River Patroller

  • Topic Starter
  • 2,514 posts
  • Distracted at the Keyboard
  • Location:Poconos, PA

Posted Mon Aug 29, 2016 2:53 PM

That also works, although you ARE burning up bytes for every CALL CHAR there... that's why a loop is more efficient code-wise. :)


And his kind of optimization needs to wait until the very last steps. Even the use of loops. I'm not completely sold on all the graphics yet. I maybe changing all of them so you can imagine it's easier for me to leave my bloat (in this area) alone until I commit to the artwork.



#74 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • 4,139 posts

Posted Mon Aug 29, 2016 2:56 PM

That also works, although you ARE burning up bytes for every CALL CHAR there... that's why a loop is more efficient code-wise. :)

 

Yep, the letters C, H, A and R are stored as is and not as a one byte token. On the other hand, I'm not burning bytes on a loop and on as many ASCII codes as in your code. ;)


Edited by sometimes99er, Mon Aug 29, 2016 2:57 PM.


#75 adamantyr OFFLINE  

adamantyr

    Stargunner

  • 1,349 posts

Posted Mon Aug 29, 2016 3:01 PM

 

Yep, the letters C, H, A and R are stored as is and not as a one byte token. On the other hand, I'm not burning bytes on a loop and on as many ASCII codes as in your code. ;)

 

Not my fault, his patterns are scattered all around. Ideally you'd want to stack your patterns in a more efficient manner, which as he's indicated, is something for the future. :)







Also tagged with one or more of these keywords: Extended Basic, Game, Zombies, zombie, platformer

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users