Jump to content

Photo

Taxi Panic!

homebrew assembly asm wip

109 replies to this topic

#26 Lillapojkenpåön OFFLINE  

Lillapojkenpåön

    Space Invader

  • 35 posts

Posted Wed Mar 2, 2016 6:48 AM

The physics and smooth animation made it fun just driving around on the buildings, am i crazy or would it be possible to also turn this into a micro machines/rc pro-am style racing game? The mini map is the only problem I can think of.



#27 walaber OFFLINE  

walaber

    Chopper Commander

  • Topic Starter
  • 159 posts

Posted Thu Mar 3, 2016 1:40 AM

Thanks for the feedback everyone!  I've made some progress on collision detection/response now.  Basically if I detect a collision between the player and the playfield, I switch to a special mode for a frame where I put 1-pixel missiles forward and to the left/right of the front of the car.  based on which of those collides with the playfield (or doesn't), I decide which way to turn the player to "steer out" of the collision:

taxi_panic_09-collision.gif

 

It's working OK.  You can still get stuck in collision in a few cases, but with a bit more logic I think I can make it work.

 

Here's a build you can try driving around the city:

:arrow:  Attached File  taxi-panic_2016_03_02_collision_response.bin   4KB   103 downloads



#28 walaber OFFLINE  

walaber

    Chopper Commander

  • Topic Starter
  • 159 posts

Posted Thu Mar 3, 2016 1:41 AM

The physics and smooth animation made it fun just driving around on the buildings, am i crazy or would it be possible to also turn this into a micro machines/rc pro-am style racing game? The mini map is the only problem I can think of.

You're right, the core car physics "feel" a lot like RC Pro-Am.  That might be another nice application of this car movement/physics code.



#29 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 22,157 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Thu Mar 3, 2016 1:50 AM

I've made some progress on collision detection/response now.  Basically if I detect a collision between the player and the playfield, I switch to a special mode for a frame where I put 1-pixel missiles forward and to the left/right of the front of the car.  based on which of those collides with the playfield (or doesn't), I decide which way to turn the player to "steer out" of the collision:

I think you can put the pixels inside the car. If the speed is 1 pixel/frame or less then put it 1 pixel inside the car for one axis. For the other axis, put it at the corner.

 

Example (dX, dY = speeds in x and y direction) 1 < dX <= 2; 0 < dY <= 1 pixel/frame):

  • pixel 1: x-corner, y-corner-1 (rounded up dY)
  • pixel 2: x-corner-2 (rounded up dX), y-corner

That way the detection pixels should be much less obvious. And you can keep them enabled all the time and save on frame for detection.


Edited by Thomas Jentzsch, Thu Mar 3, 2016 2:01 AM.


#30 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 27,824 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Mar 3, 2016 1:51 AM

Maybe you could make the car change color instead of flashing the screen when there is a collision.



#31 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 22,157 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Thu Mar 3, 2016 2:00 AM

Maybe you could make the car change color instead of flashing the screen when there is a collision.

I think that is only a (debugging) placeholder. A crash sound would be much more appropriate.



#32 maiki OFFLINE  

maiki

    Dragonstomper

  • 663 posts

Posted Thu Mar 3, 2016 4:23 AM

Whow. This looks like a killer game of 2016... And right now all in 4k!



#33 Mr SQL OFFLINE  

Mr SQL

    Stargunner

  • 1,578 posts

Posted Thu Mar 3, 2016 5:28 AM

Maybe you could make the car change color instead of flashing the screen when there is a collision.

 

Flashing the screen is OK because we did that in the 80's and the technique looks realy cool in Taxi Panic; I agreed with you flashing the screen was bad with certain colors like white; I had used that for testing and it was a horrible effect. But red is a great color for flashing because of the wavelength. I like it for meteor explosions and it works nicely here with the Taxi for collisions; makes you not want to hit the walls.

 

You need to get better at the game so you don't see the flash and go into seizures, that sounds horrible.

 

At least Walabar is not cheating  :grin:



#34 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 27,824 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Thu Mar 3, 2016 5:51 AM

Flashing the screen is OK because we did that in the 80's . . .


Programmers did a lot of stupid stuff in the 1980s.


 

But red is a great color for flashing because of the wavelength.


No color is 'great' for flashing. It's a lazy effect that bothers the eyes of some players, so you might as well leave it out.

#35 Mr SQL OFFLINE  

Mr SQL

    Stargunner

  • 1,578 posts

Posted Thu Mar 3, 2016 7:22 AM

Programmers did a lot of stupid stuff in the 1980s.


 

No color is 'great' for flashing. It's a lazy effect that bothers the eyes of some players, so you might as well leave it out.

 

Programmers do a lot of stupid stuff now that we didn't do in the 80's - some don't like playing games but still write them  :)

 

imo flashing can be overused which is a good point, but it's an excellent technique and quite effective with the right context. You have a specific disability with your vision so it causes you discomfort.

 

I understand that because I have double vision in one eye so techniques that cause double vision in games like Thrust where the objects double up on the ground are difficult for me to look at but I can see that it's still a fun game for most folk.



#36 Philsan OFFLINE  

Philsan

    River Patroller

  • 3,265 posts
  • New Orleans Saints Super Bowl XLIV Champions
  • Location:Switzerland

Posted Thu Mar 3, 2016 1:40 PM

I don't like screen flashing too!

 

But as Thomas wrote, I think it's only a placeholder.



#37 walaber OFFLINE  

walaber

    Chopper Commander

  • Topic Starter
  • 159 posts

Posted Thu Mar 3, 2016 11:28 PM

Thanks for the feedback everyone! I'm not sure if I'll stick with screen flashing, obviously you need *some* feedback when you collide and lose speed, but I'm not sure what it will be in the end. Also the collision response uses Missile 0 and 1, which I'll likely be using for pedestrians or other graphics, which will temporarily disappear when you're colliding... And the screen flash might (or something like it) might help mask that issue.

Anyway I'll keep refining it and soliciting feedback throughout the process. Next I want to refine the collision response a bit more before moving onto adding the pedestrian pickup/delivery system.

Fitting this game into 4K is going to be a significant challenge, I currently only have about 850 bytes of ROM free, and I have a lot yet to add:
- pedestrians who you can pick up and deliver to destinations, with a time limit on the delivery
- overall time limit and scoring system
- HUD for score, timer, arrow to destination, etc
- Some sounds
- Traffic patterns on some city blocks
- Some graphics to help differentiate the destinations.

The current code is not optimized at all, and the data is also ripe for more optimization, but overall it looks like it's going to be tight. I might have to make some changes to the city size or layout (maybe go random?) in the quest for more space.

Obviously I could consider going to 8K w/ bank switching, but I really do like the idea of the game fitting on a "vanilla" 4K cart.

#38 Thomas Jentzsch OFFLINE  

Thomas Jentzsch

    Thrust, Jammed, SWOOPS!, Boulder Dash, THREE·S, Star Castle

  • 22,157 posts
  • Always left from right here!
  • Location:Düsseldorf, Germany

Posted Fri Mar 4, 2016 9:31 AM

Better flash the car than the whole screen. If in reality a car crashes, the ground doesn't flash too. :)

 

And at least one missile could be replaced by the ball.



#39 walaber OFFLINE  

walaber

    Chopper Commander

  • Topic Starter
  • 159 posts

Posted Mon Mar 7, 2016 10:23 PM

I've decided to half the vertical resolution of the playfield and get some precious bytes back.  My city layout hasn't suffered too much in the change, and it saved me quite a bit of ROM space.  Here's a short video of driving around the new, more efficient city. 

 

taxi_panic_10-simpler-city.gif

I've also adjusted the collision response system a bit, it's "tighter" now.

 

I should have enough space now to start working on the customer pickup and delivery system.  Trying to decide how I want to set up the data now.

Here's the current size stats:

Free RAM: 84 bytes
Code SIZE: 1234 bytes
Data SIZE: 1226 bytes
ROM Free: 1632 bytes


#40 walaber OFFLINE  

walaber

    Chopper Commander

  • Topic Starter
  • 159 posts

Posted Thu Mar 10, 2016 1:08 AM

Good progress over the last few nights, I've got the basic data layout for my list of destinations (places on the map that customers will want to go to) implemented, and I'm drawing the destination's icon on screen as well:

taxi_panic_11-destinations.gif

 

The idea is that when you pick up a customer, their desired destination's icon will appear in the HUD, along with an arrow that gives you the general direction of the destination.  You'll need to deliver them there in a certain amount of time.

 

I still need to add a few more destinations, and then I'll move onto the passenger data and systems next.

 

current build size snapshot:

 Free RAM: 78 bytes
 Code SIZE: 1382 bytes
 Data SIZE: 1369 bytes
 ROM Free: 1341 bytes


#41 gauauu OFFLINE  

gauauu

    Chopper Commander

  • 224 posts
  • Location:Illinois

Posted Thu Mar 10, 2016 9:23 AM

How are you laying out the room data in ROM? I've been thinking about how to save space with my room layouts in my game, and wondering how you represent them.

#42 walaber OFFLINE  

walaber

    Chopper Commander

  • Topic Starter
  • 159 posts

Posted Fri Mar 11, 2016 12:05 AM

I'm not doing much in the way of space-saving... but here's how it's setup:

1. I have a list of city block layouts, which are basically just lists of playfield data.  I'm using 8 scanlines per byte, giving me only 12 vertical sections per screen.  I've also given myself a limitation that PF2 will always be mirrored (so the center 16 pixels are symmetrical). So that means for an asymmetric screen I need 5 bytes (1 | 2 | 3 | 3 | 4 | 5) x 12 tall, so 60 bytes per screen.  I also note if some designs are completely mirror-able and only store 3 bytes for those, so those are 3 x 12 = 36 bytes.

 

My city is a rectangle, so I have a constant for the number of blocks across and down for the city.  Then starting in the upper-left corner, I number each block 0,1,2,3, etc.  Given an address of a city block in rows and columns, I calculate the block index like so: (row * CITY_BLOCKS_ACROSS) + col.

I use this index to lookup some data in a master table, which tells me which playfield data to use for that block, what color the PF should be, whether the block is symettrical or not, etc.

example of the block table:

Block_0_0
	.word CityBlock0x0_0
	.byte #%00000001
	.byte #$C8
Block_0_1
	.word CityBlock0x1_0
	.byte #%00000000
	.byte #$78
Block_0_2
	.word CityBlock0x2_0
	.byte #%00000001
	.byte #$E8
...etc

hopefully that makes sense.  I know I have a lot of repeat data sections in my ray playfield data, but since I use stride calculations to find data, I'd need to write more code and make my master table bigger if I wanted to overlap data that's shared between block designs.  Later if / when I'm pressed for space I'll do more examining to see if this will be a net savings or not.



#43 gauauu OFFLINE  

gauauu

    Chopper Commander

  • 224 posts
  • Location:Illinois

Posted Fri Mar 11, 2016 10:10 AM

Cool, thanks for the explanation!    



#44 walaber OFFLINE  

walaber

    Chopper Commander

  • Topic Starter
  • 159 posts

Posted Sun Mar 13, 2016 12:09 AM

I put in the first set of destination data by hand, mostly to test out my data formatting and code to load the data in the actual game.  Now that it's working, I've started updating my city editor so that I can design and adjust destinations there.  This will make it much easier to make changes and tweak the game as it becomes more playable.

 

Here's a shot of the editor, you can now see the little destination icons on the city blocks that I've set up so far.

taxi-panic-city-layout-04-destinations.jpg



#45 ComputerSpaceFan OFFLINE  

ComputerSpaceFan

    River Patroller

  • 2,060 posts

Posted Sun Mar 13, 2016 11:51 AM

Looking awesome! What are the controls? I assume this has to be a joystick game to hit the brakes? Or would this also work with a paddle or driving controller?



#46 walaber OFFLINE  

walaber

    Chopper Commander

  • Topic Starter
  • 159 posts

Posted Sun Mar 13, 2016 9:25 PM

Looking awesome! What are the controls? I assume this has to be a joystick game to hit the brakes? Or would this also work with a paddle or driving controller?

Right now it's Joystick, FIRE button to accelerate, left/right to steer, and down for brakes.  I would like to support the paddle/driving controller if possible, although I'm not sure I'll have time in the kernel since from what I've seen you need to read the value multiple times per frame.  I think it controls pretty well with the controller though.



#47 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 27,824 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Mar 13, 2016 9:30 PM

Have you mentioned how you are making your animated GIFs? Seems like that would be a useful thing to know.



#48 walaber OFFLINE  

walaber

    Chopper Commander

  • Topic Starter
  • 159 posts

Posted Sun Mar 13, 2016 9:36 PM

Have you mentioned how you are making your animated GIFs? Seems like that would be a useful thing to know.

I use a simple program called LICEcap which is available for Windows and OS-X.  I just record myself playing the game in Stella with that.  It's a pretty great program.



#49 Random Terrain ONLINE  

Random Terrain

    Visual batari Basic User

  • 27,824 posts
  • Controlled Randomness
    Replay Value
    Nonlinear
  • Location:North Carolina (USA)

Posted Sun Mar 13, 2016 9:56 PM

I use a simple program called LICEcap which is available for Windows and OS-X.  I just record myself playing the game in Stella with that.  It's a pretty great program.

 
Thanks. I just downloaded it. What is the Max FPS setting that you use?



#50 walaber OFFLINE  

walaber

    Chopper Commander

  • Topic Starter
  • 159 posts

Posted Sun Mar 13, 2016 10:06 PM

30fps.







Also tagged with one or more of these keywords: homebrew, assembly, asm, wip

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users