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 Classic Chat / Tiled map example

Author
Message
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 5th Jul 2012 20:01
This is my idea for a tiled map system. It uses varying height sprites, so each tile is really a seperate chunk of map. It could easily be changed to suit standard tile maps, I just think that using sprites like this saves hassle when dealing with zdepth.

Please let me know if you can get it running on a device, and what kind of speeds you get. It was made in a pre-release version of AppGameKit, but hopefully it'll work fine.

Health, Ammo, and bacon and eggs!

Attachments

Login to view attachments
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 5th Jul 2012 20:29 Edited at: 5th Jul 2012 20:29
screenie...


Health, Ammo, and bacon and eggs!

Attachments

Login to view attachments
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 5th Jul 2012 21:31
Van B - What game is that? looks fun...

I am far off creating my first game in AppGameKit so perhaps I should buy the book... and get making a game or two... and then possibly try this out then...

leo877
16
Years of Service
User Offline
Joined: 6th Mar 2008
Location: san antonio, tx
Posted: 6th Jul 2012 06:20
Van B

i tried your code out...on my computer runs fast smooth about 60 fps....
on my samsung galaxy TAB 2...10.1 screen
android 4.0.3

i get around 39 fps , some black line on the map when moving DAVE...sometimes he disappear , also slower on tablet then on computer. i attach a pic so you can see.




need any more info..let me know...hope it helps.


Attachments

Login to view attachments
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 6th Jul 2012 10:02 Edited at: 6th Jul 2012 10:05
Thanks Leo. The sprites are about 2.5 times bigger than they need to be, and the example runs at 1024x768 - so I'm thinking that standard tiles would be a lot better on performance, and reducing the virtual resolution would make a difference too.
The black lines appeared sometimes on my PC before I started rounding everything, guessing that must be the difference in the resolution coupled with the big virtual resolution.

Mr Valentine, it's just a test really - don't have any solid plans for an AppGameKit game yet, just getting a feel for how I'd do things like this.

Health, Ammo, and bacon and eggs!
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 8th Jul 2012 22:17
Quote: "Mr Valentine, it's just a test really - don't have any solid plans for an AppGameKit game yet, just getting a feel for how I'd do things like this.
"



Thanks Van B, Me too I am slowly creeping towards picking up some AppGameKit but first my web stuff

leo877
16
Years of Service
User Offline
Joined: 6th Mar 2008
Location: san antonio, tx
Posted: 9th Jul 2012 03:19
van b
i test your program with afull version that i brought from tgc...if i did the upgrade right is version 1076.

i try to change the size to match my tab screen but still get the same effect.

i got question...
1. whats the difference between using standard tile maps and
sprite tile map.

any more progress with this code.


Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 9th Jul 2012 14:53
It seems that AppGameKit likes to blend the last pixels, bit of a pain, and I'm not sure if there's a workaround other than sticking to the exact native resolution of the device.

The difference between these, and standard tile maps is that the sprites are more like real sprites. With a standard tile map, you might use a 16x16 sprite, on a 16x16 grid, and these are flat - typically the player would stand on top of these, and objects would be handled seperately. One downside with standard tiles is that when you make a wall, the player is still standing on top of it, and it can be difficult to get a good impression of depth, because the player can't go behind tiles effectively. Old games like The Chaos Engine would just have the player collide with the top of a raised area, never going behind any of the backdrop. It's fine if the world is completely flat of course.
With sprite tile maps, you have Z depth as well, so a tile can be a piece of floor, or a fence post, or a treasure chest - and the player will go behind perfectly. For instance, in that example the player could be given a calculated Z depth, then he would go behing the grass blocks, all with just the Z depth, no need for more complex techniques than that. These sprite tiles are really more like the tiles an isometric engine would use. The downside with sprite tiles, is that it can be damn tricky to draw them - takes a fair bit of planning, even to get that basic 2 block tile set done took a while, I mean that's 16 images per tile, each tile is automatically set depending on if there are tiles at the sides. I tend to use binary addition to work it out. For example, start with image 1, which is a grass block on it's own, then if theres a grass block to the north, add 1 to the image, if theres one to the east, add 2, one to the south then add 4, and one to the left, add 8. Then, the resulting image is used for that block. Making those 16 images can be time consuming, but really I think it's worth the effort... whether it's standard tiles or sprite tiles, adopting a system like that means you just plonk tile 1 where you want grass, and the binary addition stitches it together nicely.

I haven't done anything with the code, but I will probably evolve it into a standard tile map example, mainly to see if it performs better. I think that a standard version would run twice as fast, because for each sprite tile, there's a lot of space that isn't needed in most sprites - means a lot of empty texture data, it's not efficient to draw too much alpha transparent images, but it might be the easiest way to have z depth. It would probably be better to have the sprite tiles split into different images - like the dirt in that example could be a 32x32 sprite set, and the grass could be 32x64 - would save some rendering time I think. If you were looking at just a flat ground, then it would probably be significantly faster, just by not drawing that blank area of texture. I will probably wait until I get the full AppGameKit package before I do much else, want to have a go at that scanline issue as well.

Health, Ammo, and bacon and eggs!
leo877
16
Years of Service
User Offline
Joined: 6th Mar 2008
Location: san antonio, tx
Posted: 14th Jul 2012 06:40
@ van b

it me again....i was trying out your sample on my tablet again and i did something, when i move DAVE off the grass. the fps will jump to close to 60fps.

i would like to try to help on this but i have no skills or knowledge on coding. i just like trying out other tgc programs(like a tester,playing around with programs) thats why i buy TGC products it more easier to learn then other programs.


3d point in space
14
Years of Service
User Offline
Joined: 30th Jun 2009
Location: Idaho
Posted: 14th Jul 2012 07:27
Van nice random tile generator simple yet effective.

Developer of Space Chips, pianobasic, zipzapzoom, and vet pinball apps. Developed the tiled map engine seen on the showcase. Veteran for the military.
DennisW
15
Years of Service
User Offline
Joined: 15th Jun 2008
Location: Ohio
Posted: 14th Jul 2012 16:40
hi Van B I ran it on my Acer tablet with android 3.2 and had FPS 24 - 26

Nice Work

Dennis

Ham and Eggs Breakfast
The Chicken was involved the Pig was Committed
7RS
11
Years of Service
User Offline
Joined: 10th May 2012
Location:
Posted: 20th Jul 2012 14:01
The line can be fixed using the snap and/or the Mag and Min filter. We had the same problem and we have fixed doing that.
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 20th Jul 2012 14:15
I would like to try this, but I'm at work and we don't have WinRar (or any program which supports .rar), gggrrr... Would anyone be so kind as to reattach as a .zip?
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Jul 2012 14:45
Yeah, I have been meaning to look into the pixel snap to see if it helps - that's good news though, thanks.

I will see if I can upload a zip version right now.

Health, Ammo, and bacon and eggs!
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 20th Jul 2012 14:46
Zipped...

Health, Ammo, and bacon and eggs!

Attachments

Login to view attachments
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 20th Jul 2012 14:56
Genius... Thank you Van B, this is a welcomed distraction from work! Excellent!
leo877
16
Years of Service
User Offline
Joined: 6th Mar 2008
Location: san antonio, tx
Posted: 5th Sep 2012 06:00
vanb

Are you making any progress on a tile map. I been looking at you Bruce 2.5 tutorial you did a couple years ago to try to make a map editor. I still enjoy playing Bruce game. I also want to know what happen to that monkey game were you break balls.


Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 5th Sep 2012 14:35
Hi Leo, not really had much time recently, final push with my monkey game - adding polish and trying to get the overal quality as high as it can go, hopefully it'll be released at the end of the month. Glad you still like Bruce, it's my favorite game that I've done, still play it with my nephews when they visit... although they did kick my butt the last time we played, so I might have to put a stop to it .

Health, Ammo, and bacon and eggs!
MarcoBruti
12
Years of Service
User Offline
Joined: 20th Nov 2011
Location: Caput Mundi
Posted: 5th Sep 2012 15:03
I have made a similar tiled-map system for DBPro. I used "image" based commands (e.g. pasteImage), and it managed wrapping, in order to create a torus-like world
Here is a link to the library signatures and file formats:
http://darkbasicgames.altervista.org/TileLibraryHelp.htm
Here is a link to a demo of the game HarryUp that uses such library (made in DBPro).
http://darkbasicgames.altervista.org/download/harryupdemo.zip
I used mappy http://www.tilemap.co.uk/ to create the map and export a CSV text file. The text file is slightly modified to match the format of the file accepted by my library.
I would like to port this library to AppGameKit, but I have got no time. If anyone is interested, I can give the source code.
IronGiant
AGK Bronze Backer
12
Years of Service
User Offline
Joined: 27th Feb 2012
Location: the great state of madness
Posted: 9th Sep 2012 19:03
OK, just found this, spent 15 minutes just walkin around, nice walking animation, should make this into a full game, Maybe a Mister Do with a miner? if you are and said so, then I missed that. But any hoot, really cool look, gonna play around with it now, thanks for the code. We do get to steal the code right?? lol

It's Bird! , It's Plane!, No its a rocket powered Squirrel holding some acorns and a smile!

Login to post a reply

Server time is: 2024-04-18 23:56:45
Your offset time is: 2024-04-18 23:56:45