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 / 2d tile engine tutorial

Author
Message
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 23rd Nov 2014 18:14 Edited at: 5th Feb 2015 04:56
Im posting a simple guide on setting up and using a 2d tile engine for a simple side scrolling game. Yes it recycles tiles!!

use and modify this code freely!

requirements: AppGameKit V2 but could be modified to run on v1
also you will need to download tile studio:http://tilestudio.sourceforge.net/

video1:


video2:


here was the moved files for this [examples for agk v1,v2]
http://www.sheldonscreations.com/forum/index.php/topic,10.0.html

www.sheldonscreations.com
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 23rd Nov 2014 18:17
the next example i will post is how to use tilestudio for map generation.

then i will post the code on loading that map into this tile engine.

Timshark
11
Years of Service
User Offline
Joined: 30th Jun 2007
Location: Oslo, Norway
Posted: 23rd Nov 2014 21:01
That´s the spirit! Looking forward to it.

I never want what I know.
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 24th Nov 2014 00:41 Edited at: 24th Nov 2014 00:43
to make this tutorial even easier im switching it over to 16x16 tile sizes.

so i have a little ninja guy animated that i just put together.

i will create some foes.... some back ground.

then i will make a video tutorial on tilestudio

then another getting it loaded into the tile engine and maybe a little game.

Attachments

Login to view attachments
Behdadsoft
10
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 24th Nov 2014 17:41 Edited at: 24th Nov 2014 17:42
Thanks SoftMotion3D.

but I can't understand your code.because I have AppGameKit v1 and I don't work with some syntax like Array and return functions.please if possible write your code easier.

what is your mean about tile engine?

Thanks.
BatVink
Moderator
16
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Nov 2014 18:32 Edited at: 24th Nov 2014 18:32
Behadsoft, the code provided is probably as simple and clear as it could be for the functions it provides. It is very well documented too.

You should read about some of the basic programming principles like arrays and functions. It may take you a few hours now to read about them, but you will be writing much better code once you understand them. They don't need to be specifically about AppGameKit, these principles are the same for all languages.

Quidquid latine dictum sit, altum sonatur
jamesL
8
Years of Service
User Offline
Joined: 31st May 2010
Location:
Posted: 24th Nov 2014 19:13
I click on the exe

I get
Failed to create XAudio2, make sure you have the "DirectX End-USer Runtime" installed.

then the game opens up with the checkerboard background and I can "fly" the guy around with the arrow keys
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 24th Nov 2014 20:43
@behadsoft ... you need to understand arrays. Where do you plan on storing an entire map scene? with vairiables?

Think of an array as a global set of memory. array[1,1,1] this is a 3 dimensional array. I can store data like this...

array[0,0,0]=5
array[0,0,1]=6
array[0,1,0]=3
array[1,0,1]=2
etc...

those are all seperate memory banks

if you need to store real numbers in the array then it should be dimmed like this.

dim array#[1,1,1]

array#[0,0,0]=5.02
array#[0,1,0]=6.297

however it is not acceptable to do this

array#[0.9,0,0]=5.2 as it is not a valid memory location (integers in the array only and to the amount you have dimmed max)

@jamsL ... try to install direct x 9.0c Secondly did you unzip the folder? cause if you didnt this would explain why you didnt get the images.

Behdadsoft
10
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 27th Nov 2014 12:32 Edited at: 27th Nov 2014 13:36
I want create 10 clone sprite with for and array. I could create them with for loop. but I don't know how can do it with array.

this is my for loop code for create clone sprite:



Please Show Me how can do it with array.

Thanks.

EDIT: because I want set each Sprite to custom Position.
Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 27th Nov 2014 14:12 Edited at: 27th Nov 2014 14:55
Like this (untested, I did it in notepad )...



And before anyone says anything, I know arrays are global by default! Just a habit of mine

EDIT: And behdadsoft, might be better creating your own thread in future Sorry SoftMotion3D...
Behdadsoft
10
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 27th Nov 2014 14:20
Thanks Funnell7. but it make only one sprite.
Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 27th Nov 2014 14:57
My bad... Try now... (fixed original post)...
Behdadsoft
10
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 27th Nov 2014 15:27
you only change () to []. in your first code I fixed it. but Problem is that don't create 10 sprite. and only create one sprite.
Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 27th Nov 2014 15:52 Edited at: 27th Nov 2014 15:55
Quote: "you only change () to []"


That's right, I had a brain fart (and this will teach me for trying to help with psuedo code )... In all honesty, I'm not sure why that isn't working, but then I've never used CloneSprite before... This way works fine though;

Behdadsoft
10
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 27th Nov 2014 17:20 Edited at: 27th Nov 2014 18:05
Thanks, work very well.

Quote: "I've never used CloneSprite before"


if you need 100 sprite in project don't use clone sprite? how can control FPS with many Sprites? there is another way without use CloneSprite?
Funnell7
7
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 28th Nov 2014 11:34
Quote: "if you need 100 sprite in project don't use clone sprite?"


No, I would do this;



You also wouldn't catch me using the percentage system
Behdadsoft
10
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 28th Nov 2014 12:37
with this method you make 100 sprite. this way is similar clonesprite? mean don't decrease FPS?

Quote: "You also wouldn't catch me using the percentage system"


this is a test. Now I use virtualresolution insted of percentage system.
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 29th Nov 2014 02:38
ok im just making a video tutorial using tile studio. will update first post to keep things clean.

anything anyone needs to know specifically about tile studio.

please ask the questions now so i can address them in the video recording. i will record it saterday(tomorrow)

-i will go over tile sets
-animating
-creating maps
-exporting maps for agk
-exporting atlas texture sets.

anything else you may want to know....please ask before i record it.

Behdadsoft
10
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 29th Nov 2014 07:42
Thanks SoftMotion3D

Now I no have any question.I wait for video.
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 29th Nov 2014 21:05
ok uploading videos...

check first post for the videos and downloadable examples.

Blue Steel AU
AGK Developer
11
Years of Service
User Offline
Joined: 22nd Aug 2007
Location: Bundaberg, Qld, Australia
Posted: 29th Nov 2014 22:54
Behdadsoft
10
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 30th Nov 2014 18:03 Edited at: 30th Nov 2014 18:05
Thanks SoftMotion3D.

but already I say that I have AppGameKit v1 and there is no some functions.

at first I thank you for tutorial and uploading video. but I have new idea for learn to me.

I begin make a game like Platform. now I want to you if possible, stop capture new video and answer my question about some Problems during make this game. because I think this way have good result instead of capture video.

Thanks.
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 30th Nov 2014 21:17
here.... i converted it to agk v1

download this for v1 users

Attachments

Login to view attachments
Behdadsoft
10
Years of Service
User Offline
Joined: 7th Apr 2009
Location: Tehran-Iran
Posted: 1st Dec 2014 08:12
thanks SoftMotion3D for convert to AGK1.

if possible think about my idea.
spasski
AGK Backer
6
Years of Service
User Offline
Joined: 2nd Jan 2013
Location: Amsterdam
Posted: 21st Dec 2014 13:31
Great stuff and thanks a lot for sharing!!!

Looking forward to see the tutorial about collision
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 21st Dec 2014 15:03
ill see if i can get around to writting the collision this week some time.

I want to post an update first on the voxel editor.

spasski
AGK Backer
6
Years of Service
User Offline
Joined: 2nd Jan 2013
Location: Amsterdam
Posted: 25th Dec 2014 10:17
wow a voxel editor, the stuff you make and share here, is having great value! I just found on your youtube channel a tutorial about tile studio, including the collision stuff. Related to the AppGameKit game jam in july 2013:

http://forum.thegamecreators.com/?m=forum_view&t=206816&b=41

Will dive into the code to get a grip on how to deal with tiles and collision

BTW. This engine is the only Tile Engine for AppGameKit which has a great solution for handling large tile maps, Well done man!


Happy X-mas!
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 27th Dec 2014 17:07 Edited at: 27th Dec 2014 17:08
ah nice!

now that is just one of the ways to do collision (manually) however you can also use the collision commands within agk.

when i get a chance to write up that example i will post it.

btw... this same tile engine works great for 3d tiles too!

Merry Christmas!

SpecTre
Developer
16
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 3rd Feb 2015 22:02
Hi there,

do you think you could re-upload your tutorial files/code/examples for the tile program to your new site as the links no longer work for AppGameKit V2.

http://www.sheldonscreations.com

or failing this could you put them on a download link on a post.

This would be appreciated as I am interested in this section.

Cheers

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
Sph!nx
10
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 4th Feb 2015 00:20
Nice work, Sheldon. Though I'm fiddling with something else atm, I'll keep an eye on this thread.

Regards Sph!nx
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 4th Feb 2015 18:09
i must have missed this when i moved sites.

yup let me see if i can update the code and links tonight afterwork.

nice to see ya around sph!nx. Are you still coding a game with dbp? or are you moving over to the agk platform?

www.sheldonscreations.com
Sph!nx
10
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 4th Feb 2015 19:23 Edited at: 4th Feb 2015 19:25
Hey mate!

I'm working with both. Not really on actual games but more on "base engines" so to say. DBP engine will be for FPS games and I'm working more and more with AGK. I still regard myself as n00b but I'm learning a lot.

I do not use messengers or other chat apps, but you are always welcome to send me a mail to catch up or something (sphinx019[at]hotmail.com)!

Regards Sph!nx
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 5th Feb 2015 04:57
ok updated on first post...

this is not much code to do this and can handle very large maps!!

www.sheldonscreations.com
SpecTre
Developer
16
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 2nd Jun 2015 05:14
Hey there, just managed to get back to this tile loader, very nice. Have you done any further videos on this yet re the collision etc?

The Amiga and Amos were great!
Download my game - Paint Pot from Amazon and Google here - http://leap.my-free.website/
SoftMotion3D
AGK Developer
13
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 5th Jun 2015 03:38
sorry...been along time since i did work with this. I've been very busy with work lately but if i get a chance i will make the next video.

www.sheldonscreations.com

Login to post a reply

Server time is: 2019-05-22 05:00:12
Your offset time is: 2019-05-22 05:00:12