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.

Newcomers AppGameKit Corner / Help on Creating World,Levels/Importing Tiles, etc

Author
Message
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 8th Feb 2017 01:58
Good Evening,

I am looking for tutorials or resources to help me learn how to import and create a world. I've read quite a few threads, but the problem is I have no idea where to begin. So too much goes way over my head.

I have read the AppGameKit Tutorial, and made great progress. I freaking loved that book. The author was an amazing teacher.

Now, I wish to test out the "world building", or perhaps, "leveling building" and importing is the correct phrase. I'm not actually concerned about the modeling part. That will come later(and this isn't the place), but I do need to know how to import that, and move my player about the levels.

The book was an invaluable resource. I wish it touched on these gameplay basics. I've looked at a few people's projects, but I have too many unanswered questions, and the remarks are usually poor to non-existent(the adventure game demo in the asset pack purchase was terrible at remarks - the code as jumbled and rushed).

I don't mind buying a book or resource, but I just want it to be applicable to AppGameKit and a true beginner to understand it.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 8th Feb 2017 08:54
I think that maybe the problem is that implementing a level can be so complicated, that even following the best possible tutorial might not help a great deal for your own game project. Really you have to know the editor inside and out, and that tends to mean writing your own. I tend to write a level editor for any project I'm working on, its about the first thing I do, as it can allow WYSIWYG editing, and allows for organic growth of features. The editor has to adapt to the game engine, so I tend to make the editor and game prototype in the same code. You have to consider and plan the way you want your editor to handle data, what variables do you need to store the location of an object, what data for a terrain heightmap etc etc, then there's logic to consider as well - do you have parameters telling the engine that an object is solid, or physics enabled, and if so - how much does it weigh and all the other considerations.

If this is your first project that you have to write an editor for, then take your time, and model some pieces for your game as well, it gives you something to visualise as you work, and you'll have a better idea of how the rest of the media has to be setup - might be something as simple as deciding where the object pivot point should be, but if you have to go back and change something like that, it can be really tedious. I like to load up all the objects and hide them, then clone them and position to layout the actual level - this saves loading time, as you only need to load 1 of each object, instead of loading an object several times. The basic data you'd need to save is the position and rotation of the object, imagine that you have a bank of objects to place on your level, and so you only need to know where an object is going, then clone it and position and rotate it. Its then possible to save this data and load it up without too much trouble. Maybe that would be a sensible start - get some media together and into a bank of objects in your game, then make a typed array to hold the cloned object position and rotation. Then things become much clearer, you can get an idea of scale and how you should setup your media, and also what else you want to add to the game or editor.

Designing levels is tedious, anyone who doesn't think so never had a project with 100 levels... you kinda have to be in the right mood, and have to take your time - so always have more than just the level editor to work on, work on media at the same time or procrastination will set in, the #1 killer of all cool projects. If you are using an AppGameKit terrain, you'll need heightmaps and terrain textures, but at least those are easy to get and give instant results. One piece of advice with file formats... if you can, make your file format dynamic, so you can add more data to it - and if you can't do that, plan your data structures and file formats, then plan them again until you are sure you haven't missed anything, because adding new requirements to a file format that is already established can be very difficult, and often result in wasted work.
The code is dark and full of errors
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 8th Feb 2017 14:31
Good info there from Van B, this thread also has a lot of game templates that are just being made:

https://forum.thegamecreators.com/thread/218621

Not sure what type of world or level you are looking to create but most of these are 2D game templates and the code is starting to be commented too to help people.

I did one in there for a 2D platform game which could also link to a WIP thread that I started with my workings of a 2D map editor etc. Not sure if it would help?

https://forum.thegamecreators.com/thread/215384


If you are looking at doing 3D then it might be an idea to start off a little 2D project first before getting into the 3rd dimension.



Good luck.
The Amiga and Amos were great!
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 9th Feb 2017 00:28
Thanks gents. Honestly, I have no idea what I want to create besides eventually a hack/slash type RPG.

My goal for now is learning how to import worlds/levels, no matter how simple or ugly the first few tries are.

I really appreciate it. I'm going to study hard this weekend. I even took time off work at the end of the month, because I wanted to understand this concept by March. You've both given me great resources to study.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 13th Feb 2017 01:28
I've still been unable to load a proper map in while allowing movement by the player.

I used "3D in Motion"s tutorial, but the map is not centered on the window borders. So, there is black space once you get close to the edge of the map. Plus, in his example the player can walk off the map into infinity. I've been unable to figure out how to stop the black space from appearing. I believe it happens, because there is no check when you get to the edges. I am not yet capable of figuring out a proper way to put that in. Something that just pauses the updating, and links the map edges to the window border. Or something that limits the player from running in the black forever.

My two ideas where to make the world move, instead of the player. I just don't like that idea very much.

The other was Blenderman's mycity demo. He's used a really nice concept, and his map was somehow set to not allow me to run past the edge of the map. I haven't been able to figure out how he accomplished that.
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 13th Feb 2017 08:16 Edited at: 13th Feb 2017 08:20
I guess you are keeping the player sprite in the centre of the screen and moving the map when the player moves?

The platform game example I did in the game templates uses this method and to stop walking off the end of the map there is a wall all the way around the edge.
The map also goes to the edges of the screen so you don't get any boarders and it wouldn't be difficult to put a background layer in.

GarBenjamin also provides a very good example in the link below using data stripped from the tiled map editor.
http://forum.thegamecreators.com/thread/218452
The Amiga and Amos were great!
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 14th Feb 2017 01:29
SpecTre,

Yes, that is what the code does. But once the player sprite gets close to the edge, since there are no tiles to display you just see black space. And the player sprite can just run into the black space forever. I'm trying to figure out how to limit this, but I don't have much free time until Sunday.

I downloaded your game, but my computer doesn't recognize the files you have. I'm guessing it, because it was done with a mac. I have no idea...


I saw Gar's. I looked it at for a second. I will study it some more.

Thank you, again.


SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 14th Feb 2017 07:18 Edited at: 14th Feb 2017 07:24
The game should run from AppGameKit as all the code is available. Download the zip file in the small game templates, it just contains the code and a text file which goes in the media folder.

You can't go into the black space as it has wall tiles all the way around.

You can also make the view stop when it reaches certain grid positions if you don't want to use a wall or a tile to stop the player.

The game has lots of comments to assist.
I am using my phone at the minute but will edit this post if can find the code.

EDIT:
OK I have found the zip file and attached it here.
The Amiga and Amos were great!

Attachments

Login to view attachments
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 18th Feb 2017 04:57 Edited at: 18th Feb 2017 15:46

Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 18th Feb 2017 05:04 Edited at: 18th Feb 2017 15:46
I used SoftMotion3D's guide, and looked at the small projects to figure out the offsetting. I eventually got it... Jeez, I can't believe it took me close to two weeks to figure it out. But, at least, I learned a shit ton.
Golelorn
8
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 18th Feb 2017 15:48 Edited at: 18th Feb 2017 15:56
I now added collision, but I noticed when he walks diagonally, between the tiles he is not supposed to cross he is able to slink through the gaps... Any tips to prevent this is appreciated.

edit: well, 1 minute later I got an idea, and answered my own question. I had to make the impassable tiles 3 pixels larger, so he couldn't slide through.

Login to post a reply

Server time is: 2024-11-22 09:52:09
Your offset time is: 2024-11-22 09:52:09