Maximum Security

Got a calculator project that you're working on, tell everyone about it
  • Author
  • Message
Offline
User avatar

Deep Thought

Topic Starter

Maximum Security

Post22 September 2012, 17:49

I've always liked making puzzle platformers, but despite having done several projects in Axe in the past two years, I still haven't made a puzzle platformer in Axe, even while several other people have done so.

To right that wrong, I worked on a puzzle platform game in Axe for the contest this year. I didn't have a storyline for it, or even a name; my plan was just to make the core as fast as possible, then stuff as many game elements into it until it ended up at a nice speed on my TI-83 Plus. But here's what I got on my first try:

http://img.removedfromgame.com/imgs/0-screenshot000.gif

That's insanely slow, even with the water taken out. I hadn't even added anything for the player to interact with yet.

I pretty much gave up for the next few months, but when I looked at my code again I realized that all that was slowing down the game was a division by 34 (:weird:) so I took that out, and suddenly it ran 3x faster:

http://img.removedfromgame.com/imgs/turret.gif

Now I could add some stuff to it, and since explosions are always awesome, explosions:

http://img.removedfromgame.com/imgs/0-turret.gif

Boulders were next. But I kinda got carried away with them, so bullets ended up bouncing off boulders in various directions:

http://img.removedfromgame.com/imgs/1-turret.gif

Here's the most recent screenshot. This is at 9 fps (instead of 25 like the others), so it might look less smooth, but it's basically the same on-calc:

Image

And now that it runs at roughly the right speed, the only big thing still planned is swimming. After that, it's just stats like points, lives, and breath count (for swimming), a level editor, and a menu screen. And a title. And a decent story line—my games have always been terrible at that :green:
Offline
User avatar

NanoWar

Site Admin

Re: An unnamed puzzle platformer

Post24 September 2012, 08:21

Very cool, maybe make the water stop at these movable balls, so that you can seal certain areas. Switches to stop the water?
So many features... I would cut some actually. Name the game Breath or Turret, but why mix everything up? I cannot imagine a solid story line yet. Why would turrets try to drown you? Maybe you should be able to fire the turrets at will?

You have good character sprites there!
Offline
User avatar

chickendude

Staff Member

Re: An unnamed puzzle platformer

Post30 September 2012, 18:13

It looks really cool, definitely lots of stuff going on and i can't really see what the point (is there one?) of it is, yet, but it all looks very cool :)
Offline
User avatar

Deep Thought

Topic Starter

Re: An unnamed puzzle platformer

Post30 September 2012, 18:23

chickendude wrote:It looks really cool, definitely lots of stuff going on and i can't really see what the point (is there one?) of it is, yet, but it all looks very cool :)
Haha well there is no point so far because there's no way to get out of a level. (It's going to be heavily level-centered, so the goal will simply be to get through as many levels as possible.)

Just made a door sprite a couple days ago, so I can add that in soon. It's a sort of a rotating portal-ish thing.

Re: An unnamed puzzle platformer

Post30 September 2012, 18:48

oo~ Very nice, can't wait to see it :D
Offline
User avatar

Madskillz

Site Admin

Re: An unnamed puzzle platformer

Post13 October 2012, 17:49

Looks cool, I agree with tifreak! I'm kinda pumped to see what you can think up to add to it.
Offline
User avatar

Deep Thought

Topic Starter

Re: Maximum Security

Post14 June 2013, 19:23

After losing and finding my calculator again, and making some odd programs on the side for contests, I'm back working on this thing. It's got a name now, too, thanks to codebender: "Maximum Security."

The idea (that he suggested) is that you're trapped in a maximum-security prison, and all the stuff you see in the level are equipment meant to keep prisoners in check. Something happened that caused all the other inmates and guards to disappear, so now you're alone to fight your way out against the mechanical stuff left in place.

Here's an updated screenshot:

Image

Since there's a lot going on in this demo level, here's a run-through of what the player encounters in the screenie:
  1. Turret (aimed at the player) launches a bullet, which strikes a boulder and bounces off. That bullet then hits the first dynamite crate, triggering a chain reaction that clears all the dynamite and steel crates from the level.
  2. Player pushes boulder onto the turret so it's safe to walk by.
  3. Meanwhile, water is pouring into the level. As the crates get cleared by the explosion, it flows down the corridors.
  4. Player collects coins.
  5. As player is underwater, his breath count (white "health" bar on the right) drops bit by bit. (Kinda proud of the bubbling animation )
  6. As the water covers the entire map, it leaves some air pockets which player uses to replenish his breath count.
Image
Offline
User avatar

chickendude

Staff Member

Re: Maximum Security

Post15 June 2013, 17:57

That's amazing. I'm just wondering why a prisoner trying to escape/not to drown would be concerned about coins? :P

Is there an objective yet? To make it to the door? I assume the door's the little spinny thing at the top right? I also love the bubble animation, Does the level filling up with water cause any slow-down? It doesn't look like it from the screenshot.

Again, that's amazing!
Offline
User avatar

NanoWar

Site Admin

Re: Maximum Security

Post17 June 2013, 15:34

Deep Thought wrote:(Kinda proud of the bubbling animation)

!!!!!!!!!!

How do you "finish" the level? Is there an exit?
Offline
User avatar

Madskillz

Site Admin

Re: Maximum Security

Post18 June 2013, 04:46

I don't think an exit is in place yet. But I agree it looks really cool. Does the water affect the player at all it looks like it does. Also I completely missed that bubble animation and it is freakin' sweet
Offline
User avatar

chickendude

Staff Member

Re: Maximum Security

Post18 June 2013, 11:06

It looks like the player moves more slowly in water but can swim. How does the water work (i mean, how does it spread to other parts)? It spreads a bit slowly, but it looks super cool :D
Offline
User avatar

Deep Thought

Topic Starter

Re: Maximum Security

Post26 June 2013, 21:14

Here's a title screen mockup. The border around START is supposed to be the selection, and it'll be animated (moving around in a box super fast, so the trail looks like a spark):

Image

Sorry for the late reply—RevSoft notifications ended up in my spam folder again...
chickendude wrote:That's amazing. I'm just wondering why a prisoner trying to escape/not to drown would be concerned about coins? :P
For some reason, the door only opens after all coins have been collected. (Notice how the door sprite changes after the last coin disappears.)

It's a bad premise, I know, If you have an explanation, please explain it away :P
chickendude wrote:Is there an objective yet? To make it to the door? I assume the door's the little spinny thing at the top right?
That's about it!
chickendude wrote:I also love the bubble animation, Does the level filling up with water cause any slow-down? It doesn't look like it from the screenshot.
Not at all—the water engine runs at O(1) :D

Water is actually treated as part of the tilemap, where each tile has a "backside" containing the amount of water there is in that tile. Since the tilemap is a fixed size, so is the water world, regardless of how much water there actually is.
NanoWar wrote:How do you "finish" the level? Is there an exit?
The spinny thing is the door, as chickendude noted. It doesn't open until all the coins have been collected.

Still working on a nice animation to transition from one level to another. I really liked Builderboy's elevator idea, so it might be something similar.
Madskillz wrote:I don't think an exit is in place yet. But I agree it looks really cool. Does the water affect the player at all it looks like it does.
It's a different mode as far as the physics engine is concerned, where the player can move in any direction, but more slowly. (Basically swimming.)

It also kills you if you stay in it too long (when the breath counter runs out).

To the engine, there are actually three distinct modes of movement in the game:
  • On the ground, you can move the player with 2nd (jump), Left, and Right. All three experience acceleration—gravity in the vertical and inertia and friction in the horizontal.
  • In air, the character maintains his horizontal velocity, but you can change it slightly by holding down Left or Right. (Think Mario jumping back onto a platform, but a lot less pronounced.)
  • In water, you can use Up, Left, and Right, and the character floats downward whenever Up is not being held. All movements in water are linear, at a speed about a quarter of the maximum horizontal speed on the ground.
There's also an unintended quirk (which I'm obviously going to call a feature) where if you hold down 2nd while moving from a platform in the water, the character will jump out of the water higher when he reaches the surface.
Madskillz wrote:Also I completely missed that bubble animation and it is freakin' sweet
Thanks! I still have quite some extra speed to work with (frames still being throttled), so I'm trying to add in little animations like that where they feel appropriate.
chickendude wrote:It looks like the player moves more slowly in water but can swim. How does the water work (i mean, how does it spread to other parts)? It spreads a bit slowly, but it looks super cool :D
As I said, each tile has two parts—one for the foreground (the actual tile to display), and one for the background (amount of water being held in that tile). Animated sprites are just sequences of tiles that change in a loop.

The water level in each tile is a number from 0 to 6, which represents the number of rows of water (starting from the bottom) to draw. Since tiles are 6x6, this means that the minimum amount of water transferred from one spot to another is a row of six pixels; while this causes some quirks where a 6-pixel-wide column of empty space (such as in the screenshot) acts as a single column of water, it does make water as a whole look a lot smoother than an engine with cellular automata of one pixel each IMHO.

The actual routine might also seem a bit odd compared to "standard" water engines. Water always flows from one tile to one to its immediate left or right first, instead of simply falling, and then dumps as far down as possible.

I'll post a more detailed description later, probably with the source.
Offline
User avatar

chickendude

Staff Member

Re: Maximum Security

Post27 June 2013, 15:47

Deep Thought wrote:
chickendude wrote:I also love the bubble animation, Does the level filling up with water cause any slow-down? It doesn't look like it from the screenshot.
Not at all—the water engine runs at O(1) :D

Water is actually treated as part of the tilemap, where each tile has a "backside" containing the amount of water there is in that tile. Since the tilemap is a fixed size, so is the water world, regardless of how much water there actually is.

That's brilliant! I guess there's also a check for falling water? Since water falls 1 pixel at a time (and adapts to which side it falls from).

I love prison-escape games (that was my ticoncours entry :P). Perhaps you could have the prisoner collect "charges" to be able to blast open the door? If a door is underwater you could even require the player to find a special item to ignite the bomb underwater. Place the bomb, hide from the explosion, and go through the new hole in the wall :D
Offline
User avatar

Deep Thought

Topic Starter

Re: Maximum Security

Post27 June 2013, 17:31

chickendude wrote:
Deep Thought wrote:
chickendude wrote:I also love the bubble animation, Does the level filling up with water cause any slow-down? It doesn't look like it from the screenshot.
Not at all—the water engine runs at O(1) :D

Water is actually treated as part of the tilemap, where each tile has a "backside" containing the amount of water there is in that tile. Since the tilemap is a fixed size, so is the water world, regardless of how much water there actually is.
That's brilliant! I guess there's also a check for falling water? Since water falls 1 pixel at a time (and adapts to which side it falls from).
Nope, I completely cheated on those nice one-pixel-wide flows.

They're just lines drawn when water from an adjacent tile decides on which side to fall and how far down. Not part of the water data at all :P
chickendude wrote:I love prison-escape games (that was my ticoncours entry :P). Perhaps you could have the prisoner collect "charges" to be able to blast open the door? If a door is underwater you could even require the player to find a special item to ignite the bomb underwater. Place the bomb, hide from the explosion, and go through the new hole in the wall :D
That makes a lot of sense, and it would give me another opportunity to add in an awesome explosion :D Thanks!

I'll probably have to redraw those spinning coin sprites then.
Offline
User avatar

Deep Thought

Topic Starter

Re: Maximum Security

Post29 July 2014, 18:13

So I came back to this after a year, and I dare say this is a few days away from being finished :)

The splash screen, level select, and level progression have been added, and external level packs load correctly from RAM and archive. Here's a quick screenshot of what it looks like now:

Image
Offline
User avatar

chickendude

Staff Member

Re: Maximum Security

Post31 July 2014, 00:03

That looks amazing. It's incredible how much is going on at once!

Re: Maximum Security

Post31 July 2014, 13:42

This does indeed boast high levels of awesome :)
Offline
User avatar

add

Re: Maximum Security

Post31 July 2014, 22:19

That is absolutely awesome!
Offline
User avatar

Deep Thought

Topic Starter

Re: Maximum Security

Post08 August 2014, 17:45

Well, it looks like I'm about 200 bytes over the execution limit :P

Probably the most awkward place to be—there's nothing I can reasonably cut or optimize further and it seems a bit of a waste to lift the limit for a whole 200 bytes of code.
Offline
User avatar

chickendude

Staff Member

Re: Maximum Security

Post09 August 2014, 02:32

There's no sneaky data bits in your code? I'm often guilty of putting jump tables and things in with my code, for example. Another option is simply to pick a routine that is 200 bytes or more and copy it to saferam and execute it from there. That's what people did "back in the day" and i still do that from time to time.
Offline
User avatar

Deep Thought

Topic Starter

Re: Maximum Security

Post09 August 2014, 03:02

That was actually my backup plan, but as the program is in Axe (all jumps being absolute), turns out that's not much of an option either. The most I could save might be 50 bytes or so :/

I think I'll just go ahead and add some more features so I don't feel so bad.
Offline
User avatar

chickendude

Staff Member

Re: Maximum Security

Post09 August 2014, 13:50

Is it a nostub Axe program? Would it make sense to convert it to an Ion/DoorsCS program and use some of those routines (like ionFastCopy)? I'm not really sure how Axe works but i assume it just pops the routines you need into the source. Alternatively you could write some assembly routines to do rearrange routines that don't need absolute jumps around. Or you could just add a bunch of new features! In my experience though breaking the 8k limit on the 83+ has been much more complicated. If you've got any suggestions/pointers, i'd be happy to hear them though.

Also, i'm heading back to China soon and will have a long 20-hour flight, i'd love to spend some of that time making levels and playing around with this if you plan on releasing it before the end of the month ;)
Offline
User avatar

Deep Thought

Topic Starter

Re: Maximum Security

Post10 August 2014, 20:43

thepenguin77 released a library to make it horribly easy to avoid the limit in Axe games.
Offline
User avatar

chickendude

Staff Member

Re: Maximum Security

Post10 August 2014, 22:49

I remember seeing that, but i've always had trouble getting the 83+ side of things to work. I played around with Crabcake and just couldn't get things to work correctly. I'll have to look at it again. Do you have any idea what the REP_NEXT equate is?
Offline
User avatar

Deep Thought

Topic Starter

Re: Maximum Security

Post11 August 2014, 01:58

Disassembling Fullrene shows ld a,a in place of REP_NEXT ... not sure what it does, could be a delay?
Next

Return to Announce your Projects

Who is online

Users browsing this forum: No registered users and 4 guests

cron