Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Showcase / [WIP] Aquillanto - 2D Platformer For Mac and PC

Author
Message
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 3rd Oct 2014 19:09 Edited at: 16th Jun 2015 10:58
ALL LATEST DEVELOPMENTS AT THE BOTTOM OF THREAD

I'm developing a 2D platform game over time and having enjoyed reading other 'diary' type posts thought I'd start my own. I'm doing it in Tier 1 as a hobby with a view to it being a PC/Mac game rather than a mobile game. Last time I did any real coding was a few(!) years ago in AMOS so it's been a fun challenge so far. I've started the project by creating my own tile editor. I looked around and found some but wanted complete control so figured I'd code my own. I've created a video of how it works which I've linked to below. It's certainly not perfect and having got to the end if I coded it again it would be far far better and more flexible but it will meet my needs.

Watch it in HD if you can.




(Excuse "because" typo!)

Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
unlikely
5
Years of Service
User Offline
Joined: 5th Mar 2012
Location: Ohio, USA
Posted: 4th Oct 2014 03:59 Edited at: 4th Oct 2014 04:00
VERY cool! Requires patience to create as full featured and useful tool as this!
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 4th Oct 2014 11:21
Hi unlikely, Thanks for the kind feedback I'm working on the actual game at the moment. The framework can load (and unload) tile-sets and maps, reveal secret passages and has parallax scrolling. The character controller is what I'm working on now - that's going to be tough! Allowing slopes and having two points of detecting the ground makes it WAY harder! I might post a video of where I've got with that so far in a bit.
Chris Tate
8
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 4th Oct 2014 17:50
A very nice looking tool

DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 5th Oct 2014 00:22
Cheers Chris
Phaelax
DBPro Master
14
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Agartha
Posted: 6th Oct 2014 04:03
Cool, nice work. How many layers does it support?

unlikely
5
Years of Service
User Offline
Joined: 5th Mar 2012
Location: Ohio, USA
Posted: 6th Oct 2014 05:18 Edited at: 6th Oct 2014 05:18
Quote: "The character controller is what I'm working on now - that's going to be tough! Allowing slopes and having two points of detecting the ground makes it WAY harder! I might post a video of where I've got with that so far in a bit. "


Sounds interesting. I've been playing around a bit with this myself. I'd like to potentially include more than two collision points so that I can do tests on other points of the character. It is a bit challenging--tempting to let the physics engine take more control.
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 6th Oct 2014 10:35
Hi Unlikely,

Physics is tempting but I'd avoid it for 2D platformers - better to 'really' control it yourself!

Re two points, I'm using two points for the floor detection and those points change the height from where they scan down to find the ground depending on the situation. I've then got another 8 points that I can scan from (it's a function so unlimited really) to detect walls and collectables etc. I've got the basics working, including slopes that can be non-linear, but I need to do thorough testing before I move on. I just know there are going to be odd situations that will break it so I need to discover those and figure out how to avoid them. I'll need to make these scans as efficient as possible and limit them to where they are needed, for example there's no point checking left hand ones if character is moving right.
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 6th Oct 2014 10:41
Hi Phaelax,

The editor supports two layers, a foreground layer and an overlay layer. The game has unlimited layers for parallax. So I'll build several single layer maps as background scenery to get that nice parallax feel and then the main map that the player interacts with (bumps into and can collect stuff from) will be a two layer map. If I built the map editor now I'd do it so that you could have unlimited layers but I think 2 will be enough in any case for my needs. If I make one of the background layers the same size as the main map it will effectively be glued to the main map (ie no parallax) so that will effectively give me three layers for the main map, albeit one of them not allowing any interaction.
baxslash
10
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 7th Oct 2014 10:46
I used physics a few times for character control and it works fine but has its headaches. I would avoid it unless you are confident with the commands and you want your character to react to forces / impacts.
Matty H
8
Years of Service
User Offline
Joined: 7th Oct 2008
Location: England
Posted: 7th Oct 2014 12:07
This is great, nice work David.

For the character I would use box2D shapes but then use contacts to program my own character controller. Collision detection is better/faster running in the core engine I would think?

DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 7th Oct 2014 20:30
Cheers Matty H for the encouragement! I've coded the main character controller. I spent all of the weekend on it! It needs thorough testing now and if it works under normal conditions I'll move on to testing it with tile based movement influences ie tiles that make the player move/accelerate etc. I also need to make sure slippery slopes work etc. I want to build a flexible framework so I can try various things out in the actual game.
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 11th Oct 2014 00:09 Edited at: 11th Oct 2014 00:11
So, here's the progress so far on he player controller. I've managed to get it working fairly quickly....but there are definite areas where it breaks so I've got to look into those. I can see this will be a 20% to get it working and the other 80% to get it working properly! Gulp.



Anyone got any tips for recording agk running without the jerking? I'm using camstudio.
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 13th Oct 2014 10:27
Spent some of the weekend brushing this up. Nothing more to show but it now works solidly (I think - more testing to be done). The main thing I had to solve was the character falling through slopes. Was a bit of a mystery! It turned out that when I got the player to run as fast as they could, and then do mini jumps(it's proportional jumps) the code marked the player down as having left the ground (they'd just jumped after all) BUT the reality was that due to the fast horizontal movement, they had in fact not left the ground as they had just penetrated it further up the slope. This got caught by the piece of code that deals with players attempting to jumping up through tiles but not quite making it...so the code allowed the player to fall...and so fall through the scenery! To find it I implemented a piece of code that allowed me to slow the looping of the code right down and then I could see it... Just one more glitch to deal with (which is a mystery) and then I can move onto tiles that make the player move...
baxslash
10
Years of Service
User Offline
Joined: 26th Dec 2006
Location: Duffield
Posted: 13th Oct 2014 12:44
The controller looks really nice. I might try something similar with one of my current WIP's is/when I get the chance to get back on it.
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 13th Oct 2014 14:52
Cheers Baxslash. The part I found the toughest was coming up with the logical rules that dictated where the player would be - easy on flat floors, much harder on slopes, especially when the slopes end at a cliff. Once I'd got that, the actual coding wasn't too bad. No doubt that slopes add a whole new dimension of difficulties!
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 20th Oct 2014 21:29
Got the external influences coded his weekend, so the player can now be moved by conveyor belt type tiles and blown by wind or dragged by a water current for example. Took a while to figure out how the influences should affect the player. In the end I went for two types of influence:

One that simply moves the player but adds no velocity to them. These influences only affect the player whilst they are in contact with the tiles (ie no velocity is imparted to the player - ie no momentum)

The other type effect actually adds a velocity to the player, so the effect continues even after the players has left the zone of influence (ie momentum).

The first system is not true to life (think - when you get to the end of an escalator you are kind of thrown forward) but seems to work within the game mechanics and I think is often used for swinging platforms etc on most games.

Next step is to add in slippery surfaces (should be easy... famous last words) and then onto how the players is controlled in water and on ladders.

Then some tidy up and randomizing of tile animations (Thanks again Naphier for your tips) then...the list goes on!

The one thing I'm really hoping is that the FPS don't drop to the point that I can't add in all the features that I want! I'm at about 1000fps at the moment (i5 4460 3.2ghz cpu) when running at 1080P.

Sorry for the long post!
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 23rd Oct 2014 10:59
Index finger sore after mashing the jump button in testing last night!
unlikely
5
Years of Service
User Offline
Joined: 5th Mar 2012
Location: Ohio, USA
Posted: 23rd Oct 2014 18:10
Ha, the joys of feature testing.

Quote: "The one thing I'm really hoping is that the FPS don't drop to the point that I can't add in all the features that I want! I'm at about 1000fps at the moment (i5 4460 3.2ghz cpu) when running at 1080P."

Cool, that seems to be pretty good performance for Tier 1 running at full-res!
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 23rd Oct 2014 22:28
I'll keep my fingers crossed re performance. I still remember coding in AMOS on the Amiga - that never took long to drop to only a few fps! I've been dead impressed so far with AGK's performance.
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 28th Oct 2014 21:26
Man...trying to strike a good feel for moving on land, jumping, being in water, and having external influences affect the player etc is tough! I can see how games, whilst the same conceptually, can be completely different in feel. I'm gradually getting there but it's taking a way longer than I anticipated and I'm having to add new code in all the time! Also got some jittering where forces act against each other (when in water the player experiences buoyancy which pushes them up...but when they get to the surface they are affected by regular gravity which pushes them down).
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 17th Nov 2014 21:34
Main controller done! Character movement now feels pretty good in water, and on land and when influenced by external factors (wind currents etc). To get to the next stage, I've got to design and build a character! Eeek! Not my forte but I'll do my best!

Couldn't resist adding in the code for collecting coins so that's done (but without the effects that will be added later).

If anyone has any tips on recording the AppGameKit screen without jerkiness I'll do a video of the game in its current form. Each time I've tried using CamStudio to record the game it comes out all jerky and recording the screen with a camera seems a bit 1990s.
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 23rd Nov 2014 21:52
Re-wrote the secret passage loading using a new format so they are faster to load in-game. They take longer to save in the map editor now but I'd prefer some slowdown there than in the game. Always really nice when you do a bunch of coding and it just works!

Next steps...

1. Add in a crude attribute system for the background tiles so I can make them not use transparency where possible for speedup.
2. Make the load level function also place the player at a chosen position
3. Do some more testing on sub-levels being loaded by special tiles

The character building has come on fine but will need to be properly rigged at some stage to generate good looking images so I'm going to do a hack for now to be able to move on and code the player sprite image determination part and have images for testing. It'll be fun when the character actually looks like he's running and jumping!
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 6th Dec 2014 20:47
I wanted to leave design to the end when the bulk of the coding was done but I need something to work with for the function that determines what frame of the character to show. So some initial design done on the character. I've decided to separate the legs and the body, so I can choose the animation of the legs and body separately. This should enable me to have the characters legs running whilst performing a separate top body move (for example striking out with a weapon) without having a gazillion frames of animation.

So, initial character design attached.

Attachments

Login to view attachments
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 6th Dec 2014 21:05
Here's a short clip of the current run cycle...
Jack
12
Years of Service
User Offline
Joined: 4th Oct 2004
Location: [Germany]
Posted: 8th Dec 2014 11:19
The run cycle is very good

You Editor is awesome - the editor can improve the workflow.
Great work


[/url]
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 8th Dec 2014 18:33
Cheers! Lots of animation frames to create before I can properly test the character generation part of the code!
Yodaman Jer
User Banned
Posted: 11th Dec 2014 18:32
David this looks great!

I do have a question, in your tile map editor you have the map being drawn more towards the bottom right of the screen to make room for the GUI. How did you do this, I can't find any command that sets the viewport to a different part of the screen (like in DBP there was a "set viewport xsize, ysize" command). I'd love to find out how you did it.

DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 12th Dec 2014 12:37
Thanks!

I have a large array that holds the information of the map (what tiles go where) and then each time the user (me!) scrolls around the map the code looks at the scroll offset and works out what part of the large array needs to be shown. The tiles are just positioned on the screen according to the scroll offset.

Does that help?
Yodaman Jer
User Banned
Posted: 12th Dec 2014 17:32
Ah, I think it does! Thanks for taking the time to answer.

I'm also curious about jump-through platforms but that's another topic for another day! I actually quite like the simplistic graphics you've got in there too, it could make for an interestingly quirky looking game.

DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 12th Dec 2014 20:04
The tile graphics are just stand in graphics for testing. I'm looking forward to doing those for real but wanted to get the main mechanics done first.

Regards jump through, from memory I think the logic I use is that in order to land on a jump through tile...
1. the player must be moving down
2. In the previous cycle, the player must have been in air (so that if the player only jumps up half way through the tile they do not land on it - they need to have cleared the tile). It gets a bit more complex (read a lot!) when you add in slopes to the equation but it's the same principle.
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 15th Dec 2014 19:42
Argh! When the player requests slow movement of the character it looks wrong to show the character running whilst only moving slowly...it's as if they are suddenly on ice...so I now have to do walk cycles for each gradient too! Argh! Am I ever going to get back to coding?!?!
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 28th Dec 2014 18:19
Done all the main character sprite frames apart from swimming and climbing ladders so I can move onto some of the coding of the character sprites! I've got separate sets of frames for the legs and body. I might have gone a little overboard but hey it's done...

300 Leg frames
100 Body frames

Lots of leg frames as I've done cycles for walking and running on the flat, going uphill (steep and shallow) and going downhill (steep and shallow) so it adds up pretty fast. Then add in crouching on all the ground gradients and well...I got to 300. Sounds excessive but the only way I can see that I'd have really reduced it would have been to remove the walking cycles...which maybe I could have done?

When I've got them coded I'll post a video.

Whilst I'm here....Happy New Year everyone!
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 2nd Jan 2015 17:51
I've managed to get the walking and running cycles done, aswell as crouching, jumping and striking. I've set the fps based on the character's speed so he walks slowly, then faster, then breaks into a slow run, then a fast run. Not sure this comes out well in the video but hey, thought I'd get something up. Only swimming and ladder climbing left to do for now. I'll most likely re-visit the character later on but I needed something to work with so I could continue the coding. So. here's the video...

Yodaman Jer
User Banned
Posted: 2nd Jan 2015 18:21
Looks great David!


It's back, baby!
JLMoondog
Moderator
8
Years of Service
User Offline
Joined: 18th Jan 2009
Location: Paradox
Posted: 2nd Jan 2015 19:44
Very nice animations. Like how the feet stick to the terrain.

Only thing I noticed is the controls seem to be a bit stiff. Maybe add some momentum to him so that instead of coming to a complete halt he slides a bit.

Just a thought. Good work.

<a href="http://www.slidedb.com/games/kayak-escape" title="View Kayak Escape! on Slide DB" target="_blank"><img src="http://button.slidedb.com/popularity/medium/games/34310.png" alt="Kayak Escape!" /></a>
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 2nd Jan 2015 20:11
Hey, thanks guys.

The character has some momentum but I've kept it pretty tight so far (except when he's on ice - represented as blue on this test map). Certainly something that I can look into at some stage. My guess is I'll do quite a bit of controller tweaking when I have some full maps to play.
unlikely
5
Years of Service
User Offline
Joined: 5th Mar 2012
Location: Ohio, USA
Posted: 6th Jan 2015 02:30 Edited at: 6th Jan 2015 02:30
Looking great David! I love how his feet follow the ground contour.

Aside from the slightly "stiff" appearance of the movement (might be right for the feel...), I think it seems a little jumpy when he lands. The animation just seems to suddenly switch from jump/fall to idle and is not as smooth as the rest of the excellent animation. Dunno exactly how that could be smoother (I'm certainly not an artist! )

Yeah, looking GREAT though! Well done so far.
george++
10
Years of Service
User Offline
Joined: 13th May 2007
Location: Hellas
Posted: 6th Jan 2015 12:51
Very nice job!
Do you use physics for your character?
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 6th Jan 2015 16:57
Cheers guys...

unlikely - Re the landing - I'll take another look at that at some stage. It's pretty tough to get seamless animation when there are so many combinations (eg landing on flat or slope, landing whilst walking or running etc) so I'll probably never get it 100% but I'll take another look later in the project - cheers for the critique. Thinking aloud...I could add a land sequence for each of the five gradients...but they'd only really come into play if the player landed without requesting further movement...hmmm, might work though... Oh and thanks for spotting the feet on ground - it works in all but a very few situations and took quite a bit of work so good that it's noticed!!!

george++ - Cheers! No physics used. The controller is coded so I have full control over how he moves. Makes it harder to get going but I think it'll lead to fewer headaches later. That all said I've recently discovered a weakness when the player comes across slopes whilst in water...so I've got a bit more work there to do! Have to say though, it's feeling pretty sweet to control - less momentum than Mario but more than Leander (Amiga) for those who can remember that excellent game!!!
george++
10
Years of Service
User Offline
Joined: 13th May 2007
Location: Hellas
Posted: 6th Jan 2015 17:14 Edited at: 6th Jan 2015 17:15
Quote: "The controller is coded so I have full control over how he moves"

I absolutely agree with you!
Keep up with this nice project
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 13th Jan 2015 09:19
Thought I had the controller finished until I did another test map the other day and combined slopes and water...the character fell through the slope - Argh! Turns out that it was a weakness in the controller that I had previously witnessed in another situation but "got around". I'd always relied on the character falling in order to be able to land on the ground - sounds logical BUT another way you can 'land' on the ground is to move along horizontally and bump into a slope (the ground comes to you, rather than you to the ground). Once I'd figured out what was going on I fixed it and it removed the need for the workaround I had done earlier so a good result all around. A lesson for me... fudge fixes don't work long term! If you ever spot anything not 100% right - fix it immediately!
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 22nd Jan 2015 20:11
BOOT CAMP! With the character controller finished, I've created a few "Boot Camp" maps to check that my character performs well with external influences (speeds and accelerations) etc. I've also added in a couple of clips that show him climbing ladders and swimming.



Next steps...Some tidy up stuff, then I'll be moving onto the next big task...coding the populating editor, which will enable me to fill the levels with monsters, swinging platforms etc. It's going to be quite a project so I'll be doing more planning than I did with the map editor! To break it up I'll also start developing the graphics for world one.

Now using Tier 1 AppGameKit V2
My replacement for AMOS!
george++
10
Years of Service
User Offline
Joined: 13th May 2007
Location: Hellas
Posted: 22nd Jan 2015 22:23
I like the progress of your game. Keep going!
Conjured Entertainment
AGK Developer
11
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 25th Jan 2015 00:21
This is looking great.
Your animations are really nice.
So, you are posing in 3d modeling program to take snapshots of frames for the 2d sprite?
That is a real time saver if you already have the models, and gets nice highlights the easy way.

Quote: "Physics is tempting but I'd avoid it for 2D platformers - better to 'really' control it yourself!"

Was thinking the same thing, but having trouble with my jumps, so my platformer went on hold.


Using AppGameKit V1 Tier 1
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 25th Jan 2015 20:58
Hi,

George++ - Thanks

Conjured Entertainment - Yes, the character was built for the game in a 3D application (modo - fantastic piece of software) and I render out 2D images to use as sprites. I'll be using the same technique to generate the tiles and enemies and moving pltforms etc. If you want to do a platformer I'd code the controller rather than use physics. If you want an easier ride, avoid slopes and try for a character that only requires one foot sample point. When I coded in AMOS a few(!) years ago I started a platform game called "Bouncy Orange" which, as you've probably guessed used a simple orange ball with eyes as the main sprite. Meant a single contact point and I didn't have any slopes - it's 1000 x easier than slopes with two contact points!

Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 1st Feb 2015 17:52
Sprite loading has been coded. I've created a spreadsheet which generates default decode files for the sprite atlas images. The decode files state the animation frames (from and to) and the fps for each animation as well as the hit shape. At a later date I'll come back and create a simple editor which allows for the hit shapes to be altered. The built in debug feature is great for checking hit shapes!

I'm now working on the level populating editor which will enable me to populate the maps/levels with enemies, moving platforms and other types of sprites. Output from this will be a data text file that is loaded into the game. It'll take a while to code but when it's done I'll post a video of it.

The populating editor is actually being built into the game itself (it'll be ripped out at the end) so I can add elements to the maps and test them out right off the bat....well, that's the theory anyway!!!

Anyone know...I'm guessing that sprite clones take very little memory? My guess is that they are just pointers to the original sprite in memory (in terms of the image data). Is this right?

Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
unlikely
5
Years of Service
User Offline
Joined: 5th Mar 2012
Location: Ohio, USA
Posted: 1st Feb 2015 21:36
Quote: "Anyone know...I'm guessing that sprite clones take very little memory? My guess is that they are just pointers to the original sprite in memory (in terms of the image data). Is this right?"


If you load an image using loadImage() and then use that image for multiple sprites, it would use the same image data... and by extension, I think that if you use cloneSprite() it will use the same image data, unless you used loadSprite(). CloneSprite() creates a new sprite, however, that has all of its own properties and physics body, etc., so it's not the same object (aside from possibly image data, if loaded separately.)

Not positive though, that's just what it seems like logically and from the docs.

The docs say this about loadSprite():
Quote: "This command takes an image file name and loads it specifically for this sprite, this image will be deleted when the sprite is deleted. If lots of sprites are going to use the same image you should load the image separately and pass its ID to the CreateSprite command to save memory. "


Using AppGameKit v2 T1 + T2!
Systems: Primary: Mac OS X 10.10
Secondary: Windows 7
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 2nd Feb 2015 21:59
Cheers for the info.

Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
DavidAGK
3
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 22nd Feb 2015 20:41
Reminder to self...extensive comments are super useful when you come back to your code after a break!

Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)

Login to post a reply

Server time is: 2017-05-26 19:48:27
Your offset time is: 2017-05-26 19:48:27