NRV Posted August 28, 2017 Share Posted August 28, 2017 Hi, this a platform game engine that I did mostly in 2010. Recently I added the enemy logic, the laser barriers animation and some other details.I hope people can find it useful to look at the code, or maybe use it as the basis for a game.What I implemented is a system a little more complex than what you normally see in the A8. Most movements have a different speed and acceleration defined, and some of these values use fixed point math. For example you can define the speed for walking, jumping, falling, swimming, climbing, and the accelerations used to reach those values. Also you can hold the jump input for higher jumps and use some air control.Right now you shoot with the button and jump moving the joystick up. I don't like this much, but I wanted to test having both options for this prototype.I normally play in a pc using the keyboard, so maybe the values are a little too sensitive for a real joystick.There is a PAL version, but is a little different than the NTSC one. I did translate the speed and acceleration values, but it seems applying them 50 times per second has not the same accumulated effect, that at 60 fps (it feels more "floaty"). Also, there is a precision problem trying to translate the smaller values (should use more bytes).Here, a video: The engine is pretty efficient, most of the time in the frame is free as you can see here:For example, the enemy logic only updates one enemy per frame, looking if the player is near and then shooting in the correct direction (if the cooldown and the number of enemy missiles allows it).Other details:- Most collisions tests are char based and assume a player with the current size, but they can be changed for bigger players. Only the collision between the player (P0) and any danger, use the hardware registers.- The player logic use a system of states to know how to move and what collisions to check (over platform, jumping, falling, climbing and in water). The color of the player changes according to the state and also to what he hits, but this was for debugging.- The camera speed is based on the distance to the player, so is smoothed out a little.- Most objects coordinates in the level use 2 bytes and are translated to screen coordinates before rendering. With a moving camera you need to update your player/missile graphics, not only when they move, but also when the camera does it.The level was done in Envision PC (the "reborn" version) and is easy to modify, but there is not much error checking, so beware. Code was done in mads and tested in Altirra, as always.The condition to "win" this demo is collecting all coins and destroying all enemies (the clock stops then). My record for this is 1:16.1 in NTSC, but I died once open_plat.zip 30 Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted August 28, 2017 Share Posted August 28, 2017 i love the physics... Quote Link to comment Share on other sites More sharing options...
emkay Posted August 28, 2017 Share Posted August 28, 2017 (edited) What you name "platform game engine" looks already like some top notch game for the Atari. How about "Cursor'S World" ? Edited August 28, 2017 by emkay Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted August 28, 2017 Share Posted August 28, 2017 "Adventure 3"... Quote Link to comment Share on other sites More sharing options...
+Stephen Posted August 28, 2017 Share Posted August 28, 2017 Fantastic! Thanks for sharing the code. Quote Link to comment Share on other sites More sharing options...
+JAC! Posted August 28, 2017 Share Posted August 28, 2017 Looks and plays totally cool. As heaven said, the physics are really great. Keep the Player's look, name it "Super Mario Blocks" and release it :-) Do you know MADS' ".PROC/ENDP" statement? It allows for very nicely defined local labels, so you don't need the prefixes: .proc CheckCreateEnemyMissile ; check for a free missile index ldx #2 lda TabMissileOwner,x beq found_one_free ldx #3 lda TabMissileOwner,x bne exitfound_one_free lda #>[ENEMY_MISSILE_SPEED_X] sta TabMissileSpeedX_H1,x lda #<[ENEMY_MISSILE_SPEED_X] sta TabMissileSpeedX_L1,x lda m_enemyShootDirection exit rts.endp Still you can jump into where you need with "CheckCreateEnemyMissile.found_one_free" 2 Quote Link to comment Share on other sites More sharing options...
+Philsan Posted August 28, 2017 Share Posted August 28, 2017 Awesome, thank you! Quote Link to comment Share on other sites More sharing options...
NRV Posted August 28, 2017 Author Share Posted August 28, 2017 It makes me think also in Adventure 3.. if Adventure were a platform game Looks and plays totally cool. As heaven said, the physics are really great. Keep the Player's look, name it "Super Mario Blocks" and release it :-) Do you know MADS' ".PROC/ENDP" statement? It allows for very nicely defined local labels, so you don't need the prefixes: .proc CheckCreateEnemyMissile ; check for a free missile index... rts.endp Still you can jump into where you need with "CheckCreateEnemyMissile.found_one_free" Yes! .. in fact I learned it from you, when looking at your example code to create a 1MB cartridge, directly from a mads source. I used .proc a lot when moving the projectM presentation to use a cartridge, but this one here is very old code. Another thing very useful when using .proc, was the option to set a specific assembly address, for when you need to move your code from the cartridge to normal ram. 2 Quote Link to comment Share on other sites More sharing options...
+Adam+ Posted August 29, 2017 Share Posted August 29, 2017 Yeah, many thanks for sharing the code! I used .proc a lot when moving the projectM presentation to use a cartridge, but this one here is very old code. Well... I have to ask: any news about Project M? 1 Quote Link to comment Share on other sites More sharing options...
emkay Posted August 29, 2017 Share Posted August 29, 2017 Yeah, many thanks for sharing the code! Well... I have to ask: any news about Project M? You should look at some threads below 2 Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 1, 2017 Share Posted September 1, 2017 Nice, reminds me a little of WTBOY 2 Quote Link to comment Share on other sites More sharing options...
NRV Posted September 1, 2017 Author Share Posted September 1, 2017 Nice, reminds me a little of WTBOY Nice. The "infinite" jump is in the code, but commented, the "wall grab/slide" should be easy to do, and something like the big wheels could be done easily by animating chars in the font (but maybe using 2, 3 or 4 fonts interleaved in the screen). I believe one of my inspirations at that point of time, was something like star guard: Also doing something with a fraction of the options in n++ (and a little less hardcore), would be nice.. kind of a modern lode runner. 9 Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 1, 2017 Share Posted September 1, 2017 N++ is nuts The physics you've developed could be adapted for something along the lines of the co-op Ibb and Obb Quote Link to comment Share on other sites More sharing options...
jvas Posted September 2, 2017 Share Posted September 2, 2017 Tested on Eclaire. Works find! Looks very polished. Thanks! 1 Quote Link to comment Share on other sites More sharing options...
Sandor / HARD Posted December 18, 2017 Share Posted December 18, 2017 I love this! Like others said, I think it's a game already, not just an engine. Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted December 18, 2017 Share Posted December 18, 2017 (edited) This looks to play better than wtboy. nice. and it's open as an engine, even better! Edited December 18, 2017 by _The Doctor__ Quote Link to comment Share on other sites More sharing options...
TattooRose Posted April 8, 2018 Share Posted April 8, 2018 Hi, I am just getting back into 6502 programming after about 35 years so any help would be appreciated. Here is what I am doing with the open plat engine. I have create a sprite using player 1,2,3 for color. It's dimensions are 8 x 21. I updated the draw player routine to support drawing the sprite. For all the area's of the code I could recognize I updated any values to match the sprite and made some of them constants. I am using the same screen dimensions as the sample but have provided my own character set. The first thing I see is when the character walks off the right side of a platform he goes out a full character width before he begins his fall. Also when I move him all the way to the right he goes past the window right limits after the tiles have scrolled. Can someone shed some light on if I have missed a setting or something. Quote Link to comment Share on other sites More sharing options...
NRV Posted April 8, 2018 Author Share Posted April 8, 2018 Hi, I am just getting back into 6502 programming after about 35 years so any help would be appreciated. Here is what I am doing with the open plat engine. I have create a sprite using player 1,2,3 for color. It's dimensions are 8 x 21. I updated the draw player routine to support drawing the sprite. For all the area's of the code I could recognize I updated any values to match the sprite and made some of them constants. I am using the same screen dimensions as the sample but have provided my own character set. The first thing I see is when the character walks off the right side of a platform he goes out a full character width before he begins his fall. Also when I move him all the way to the right he goes past the window right limits after the tiles have scrolled. Can someone shed some light on if I have missed a setting or something. The PM's are only the graphical representation of your player, internally the code assumes (is hard coded right now, if I remember correctly) that you are moving an object of 4x8 pixels (1 char). So you would need to update the size of the internal "collision" object through the code.. I would need to take a look for possible unknown problems, but at least change this code, in pro_P1.asm: ; set size in pixels ldx #4 stx m_playerSizeX dex stx m_playerSizeXMinusOne ldx #8 stx m_playerSizeY dex stx m_playerSizeYMinusOne jsr InitPlayerInfo ... Is not that simple anyway, because with a sprite so big you need to add more collision checks, to avoid going through small objects (the collision checks right now are done only in the corners of the player). You would understand if you try it The other solution is that your level doesn't use walls or platforms that are smaller than the player. Regards. Quote Link to comment Share on other sites More sharing options...
TattooRose Posted April 9, 2018 Share Posted April 9, 2018 Hi, Thanks for the explanation of your code base. It is very helpful. I did create a PLR_WIDTH and PLR_HEIGHT set of constants and applied them in the area you outlined along with any other places in the code where they would be considered. I will look into adding more collisions points maybe 3 for top and bottom and 4 for left and right and see if that yields the desired results. Regards Quote Link to comment Share on other sites More sharing options...
TattooRose Posted April 19, 2018 Share Posted April 19, 2018 Hi NVR, I would like to ask your permission to use your code base as part of a set of videos I am looking to put together on Game Programming on the Atari. This set of videos has two purposes, first to help me further my understanding of the code and concepts and two to hopefully invite people to join with comments and suggestions which should help others and me further our understanding. Thanks again for the great engine. 1 Quote Link to comment Share on other sites More sharing options...
NRV Posted April 20, 2018 Author Share Posted April 20, 2018 Hi NVR, I would like to ask your permission to use your code base as part of a set of videos I am looking to put together on Game Programming on the Atari. This set of videos has two purposes, first to help me further my understanding of the code and concepts and two to hopefully invite people to join with comments and suggestions which should help others and me further our understanding. Thanks again for the great engine. Sure, go ahead. It's here to be used 1 Quote Link to comment Share on other sites More sharing options...
TattooRose Posted April 20, 2018 Share Posted April 20, 2018 Thanks Quote Link to comment Share on other sites More sharing options...
TattooRose Posted May 21, 2018 Share Posted May 21, 2018 Hi All Here is a link to the git repository of my updates to NRV's Open_Plat engine. It's is in the early stages but it does load as a XEX and does run in Altirra. My latest attemp has been to create moving platforms in the game and I do have a platform moving. The animation is very coarse so I was hoping that someone can take a look as offer some suggestions. Also there is a bare bones implementation for sound using RMT. I need to find some better effects and music but that also seems impossible. I have looked and tried to convert SAP to RMT with no luck using ASAPCONV. If anyone knows how to do this with SAP or WAV files that would be a big help. Lastly, I have tried different ways to implement a VBI routine again with no luck. Any help there would also be appreciated. Here is the link to the repository. https://github.com/TattooRose/Scroller.git Thanks in advance 3 Quote Link to comment Share on other sites More sharing options...
+JAC! Posted May 22, 2018 Share Posted May 22, 2018 I need to find some better effects and music but that also seems impossible. I have looked and tried to convert SAP to RMT with no luck using ASAPCONV. If anyone knows how to do this with SAP or WAV files that would be a big help. Lastly, I have tried different ways to implement a VBI routine again with no luck. Any help there would also be appreciated. ASAPCONV should work fine for that, but of course only if the original file was RMT and not CMC, TMC or ... Can you be more precise about what/where you are trying to use/setup the VBI and what is not working? Quote Link to comment Share on other sites More sharing options...
NRV Posted May 23, 2018 Author Share Posted May 23, 2018 I haven't looked at your changes, but in my original version I change the NMI handler to point to the only DLI, and the VBI is not enabled. You can put your code inside that DLI if your only interest is doing some changes once per frame (like calling RMT's update). Is there a xex with your changes in there? I don't think you want to play digital sound, so forget about wav's for now. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.