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 / Making a simple Old School Style FPS Game in AppGameKit 2

Author
Message
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 2nd Feb 2018 05:03 Edited at: 2nd Feb 2018 05:16
Okay, so I have not done any game dev for a few months or so now. Recently came back to these forums and seeing all of the cool stuff you folks are making got me interested in doing some game dev again.

Tonight I started on creating a simple old school style FPS game.

And when I say old school style I am talking about the very old ones that uses keyboard controls only not mouse and keyboard.

This is obviously very early on but it feels right so far.

There is no texture mapping... just solid colored walls... but like the games of old that used color cycling creating colored bands to simulate 3D I use this FX on the floor, ceiling and walls even though everything really is 3D. Because it strengthens the 3D movement FX and again it connects it more to those old school games I enjoyed so much.

There is no collision checking yet. When you run the project just "pretend" collision checking is in.



The project is attached to this post. It is tiny just 8 KB. There is no media. Just one main file which I will also include right here.




OH! I should mention this is just something I am dabbling on. I will work on it when I feel the urge to. Almost certainly will not be every day. But I will try to do some more on it sometime this weekend. All depends on what all else is going on.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)

Attachments

Login to view attachments
puzzler2018
User Banned
Posted: 2nd Feb 2018 07:29
Looks promising, keep it up and quiet a nice method on how this is achieved
Lance
20
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 2nd Feb 2018 13:45


"Tonight I started on creating a simple old school style FPS game." :

I have been doing the same thing . These type of '3D' look games started it all ; thanks to John Carmak and ID Software . I started out making a 'map' editor and loader using cubes (top down view). It saves the 'map' out as a .txt file . I only do programming starting in late October and stop by the middle of March (winter months) .To me ,it's only a hobby . I purchased AppGameKit back in November . What has slowed me down was not being able to edit a 'map' very well using memblocks .

Lance



GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 2nd Feb 2018 14:33 Edited at: 2nd Feb 2018 15:30
Thanks @puzzler2018

@Lance I understand you very well. My main dev time runs through that same time period although some years I have done projects in late summer early fall. I enjoy being outside moving around doing stuff too much to be sitting staring at the screen. Especially when I already work on the computer all day programming for my job.

Yes I thought the same thing about a map editor. I have experimented with alternatives to map editors many times so I knew a simple string map in code, a simple text map file or an image would work fine.

I will almost certainly end up switching over to using an image to define the map. That works very well just a simple 20x20 image in this case where each color coded pixel represents one block cell in the game. Of course I would have 3 of those in this case for the visual layers. Then I either use the one with the walls or add a 4th that defines doors, enemies, collectibles and so forth.

It is pretty flexible and relatively easy to work with especially going the image route.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Lance
20
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 2nd Feb 2018 15:17 Edited at: 2nd Feb 2018 15:23
A pic of my map editor . Didn't know what size I should post so I reduced it 50% .

A little too dark

Attachments

Login to view attachments
GunnerJnr
AGK Developer
8
Years of Service
User Offline
Joined: 30th Nov 2015
Location: Bridgwater, UK
Posted: 2nd Feb 2018 18:25
DOOM

looks great!
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd Feb 2018 22:23
Looks awesome. Are the NPCs going to be images on planes or full 3D?
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 2nd Feb 2018 22:31
Glad you like it!

I have put no thought into that yet. Just a for fun sort of tutorial thing (I need to work more on that part in the posts) I just figure stuff out as I'm writing it. BUT I'd guess the enemies will be 3D and almost certainly just red cubes stretched vertically. Probably some very basic movement-based animation for walking and so forth. Collectibles just tiny cubes rotated to stand on one point spinning around. That kind of thing.

Ha ha. I hate getting sucked into the black hole of graphics stuff so strive to keep that aspect very simple while using little touches to make it look decent.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
puzzler2018
User Banned
Posted: 2nd Feb 2018 22:32
We all learn from somewhere - i never knew 3D until 2 weeks ago and quiet ok with it - lots more to learn
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd Feb 2018 22:51
If you wanted to go planes with animated textures i have some horror type sprites that might suit.
things like Dracula, Mummy Frankenstein
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 2nd Feb 2018 22:58
I simply rewrote parts of my sprite editor to become a mapper to get started..
but iam going to write a dedicated mapper in 3d instead as it will speed things up and see how players see the World faster without playtesting alot..
I use textured planes that i animate by image swapping for my enemies.
Good to see some more retro fps games in the works ...

Attachments

Login to view attachments
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 2nd Feb 2018 23:11 Edited at: 3rd Feb 2018 00:03
That is definitely an option and is how I animated the enemies in my Mutant Invaders 3D shmup game.

Just cubes brought to life with animated textures (SetObjectImage) and programming.

We'll see how it goes. Right now I am thinking very basic. Taking a very relaxed approach to it all. Lol

EDIT: Not sure how I missed this was going to write it first. Been another busy workday and I wrote this post right at the tail-end of it. I guess that is as good of an explanation as any. lol

Anyway @blink0k thanks a lot for the offer! I will definitely keep it in mind. I think mainly what I was thinking is I can make a simple game then people can replace the graphics etc. Basically they can reskin it as they want. It's not something I am making to release to public just here on the forums. BUT I definitely appreciate the offer and may end up taking you up on it.

Right now it is Friday and the workweek has finally ended. Going to check out a few threads around here then get off this thing and relax with a nice cold beer.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 2nd Feb 2018 23:36
I thought this guy did an awesome job of using billboards. He's done some animation and even used multiple planes to show NPCs getting slashed
Slasher's Keep
puzzler2018
User Banned
Posted: 2nd Feb 2018 23:38
A bit cartoony but fun
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 3rd Feb 2018 03:47
Reminds me of Bards Tale and old Might and Magic. I like it!
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 3rd Feb 2018 05:01 Edited at: 3rd Feb 2018 05:15
Okay, I decided to do a very quick update just to show how easy it is to reskin a game project / update the graphics.

Previously this was using untextured cubes. Now they are textured.

Just some fast images I knocked out to illustrate this. Feel free to draw whatever you want for those textures. You can actually give variety by creating the additional 2 images for each of the 3 types (floor, wall and ceiling)


I will quite likely revert back to the original untextured when I next work on the project.

Just wanted to show it is super easy to change up the visuals. My focus is always on the actual game programming mainly because I find graphics to be like a black hole a person (well at least me) can spend hours, days and weeks on just iterating over and over and over again... and hence nothing gets done... no actual progress made! lol So I avoid it as long and as much as I can.

But I know lot of people like this stuff so this shows how easy it is to switch over to textured images.

Alright no more time on graphics. Next time I will get something done on the game. Maybe update the map creation to use images (ok so I would make more graphics for that lol). Or maybe just add some collectibles. No idea yet but it will be something focused on supporting game play.

NOTE: I was going too fast and did not clearly comment about all 3 methods creating the block types but you will see the pattern in there. Floor, Walls, Ceiling.

You will need to download the project for this because the media folder now has these images in it.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)

Attachments

Login to view attachments
Rick Nasher
6
Years of Service
User Offline
Joined: 25th Jul 2017
Location: Amsterdam
Posted: 3rd Feb 2018 08:27
Oh-oh.. I can see a creature with an ax lurking round the corner.
hoyoyo80
7
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 3rd Feb 2018 11:19
Old school Sword and Arrow pls...might and magic
hoyoyo80
7
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 3rd Feb 2018 11:24 Edited at: 3rd Feb 2018 11:26


Sidenote: I still love old school fantasy rpg compare to NexGen RPG, make me feel younger with all unicorn and dragon stuff
basicFanatic
6
Years of Service
User Offline
Joined: 7th Jun 2017
Location:
Posted: 3rd Feb 2018 12:03
Remember Isle of the Dead? Since the baddies were zombies, they always walked straight towards the player. This meant that they didn't need a sprite for each direction they could be turning. (The game actually had mouse movement, but it was kinda broken)
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 3rd Feb 2018 15:37
If you haven't yet, you all should really check out Malevolence

http://store.steampowered.com/app/268930/Malevolence_The_Sword_of_Ahkranox/

It is an old school RPG based on this style, made with DBpro by Cumquat .

Good stuff
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 3rd Feb 2018 16:23
I would probably recomend a 3d based editor..
i rewrote my old 2d one to 3d in under less the 150 lines of code..
Simpler to see how it would look ingame with textures etc.

GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 3rd Feb 2018 18:14 Edited at: 3rd Feb 2018 19:44
@Ortu That Malevolence: The Sword of Ahkranox looks quite interesting! I just checked it out on Steam.

@Cliff Looks like a great 3D level editor. I was working on a 3D world editor many months ago.

I don't want to get into this kind of stuff here. It's all great stuff but my intent here is only to make a little tutorial type of thing. An unfolding game with source shared here on the forum just in the hope it may be of help to someone. Maybe a new person comes to AGK2 and has no idea where to start to build a maze exploration style of game. This gives them a starting point. @Xaby mentioned the idea in another thread about making some larger examples (than that sample pack we all contributed to a while back). So I thought that sounded like fun.

Just wanted to clarify that I am not making a game here as in an actual game intended to be released on Steam or something like that. That would be far too time consuming and ambitious for me! lol :p

But maybe someone else with a ton of free time & a strong hunger to be the next big Indie game dev superstar can take the base code and expand on it greatly and reskin the graphics to create a game they release for sale or whatever.

For me this is just a bit of fun that may help someone else.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 4th Feb 2018 05:53 Edited at: 4th Feb 2018 06:13
Okay so I actually did work on this again tonight.

After having a quick play of the bit that was in I decided to focus on some very important things:

1. Collisions with the walls. And not just stop moving collisions but sliding along the wall collisions.
2. For anyone wanting to replace the textures I decided I might as well do some graphics work after all and create the 3 images for each of the block types: floor, walls and ceiling.
And so I decided I might as well create a reasonably pleasing palette and have it done with. Something I can stick with from now on.
3. And since I did that I figured I might as well add fogging as well just for that final touch.
4. Oh and I decided to make the movement and turning twice as smooth as it was before and adjusted the speeds on both a bit.

So now it looks like this and all images are in the media folder so people can easily draw their own textures...


And here is a gif of moving and sliding along the walls...


I also made some changes to the size of the blocks and turning collisions on for walls and off for the floor and ceiling.

AGK2 project source is attached to this post. Whopping 14KB.

Alright movement is done! Next time I can get on to some collectibles, or maybe some fireball shooting would be cool.

In case anyone is curious I am thinking about an old game Catacombs Abyss 3D. Not saying I am setting out to make that game just saying I like the whole fantasy magic user and monsters theme.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)

Attachments

Login to view attachments
Ortu
DBPro Master
16
Years of Service
User Offline
Joined: 21st Nov 2007
Location: Austin, TX
Posted: 4th Feb 2018 06:28
Coming along nicely man. The fog is a nice touch
http://games.joshkirklin.com/sulium

A single player RPG featuring a branching, player driven storyline of meaningful choices and multiple endings alongside challenging active combat and intelligent AI.
Lance
20
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 4th Feb 2018 17:32 Edited at: 4th Feb 2018 19:48

I used some code from one of Cliff Mellangard 's projects (DBP 'Rolfenstein') to make my 3D map editor . It's very basic but it works . It is not even close to what he has done with his latest example posted above .

I tried to upload a video but it just won't go , sorry ....
Lance

Attachments

Login to view attachments
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 4th Feb 2018 18:08 Edited at: 4th Feb 2018 18:24
Thanks @Ortu.

@Lance I consider building a Map Editor / Level Editor out of scope for this project but I do think a new thread Making a Simple 3D Map / Level Editor in AGK2 would be worthwhile.

For this project I see it like the map data can be generated in multiple ways. We all know this. One can create a dedicated editor application to do it, or they can use Tiled and layers (which is what I may switch over to since it is perfect for building levels for this kind of game.... just have 3 layers in the Tiled map... floor, walls, ceiling... of course then I'd store collectible, enemy, door, etc positions in the map as well), typing it out in a separate text file that is loaded, typing it right inside the program code as I am doing here, etc.

A dedicated thread on building a level editor would probably be a very good thing. I need to focus on enemy placement and such anyway so I will almost certainly be showing how to use the free Tiled 2D Map Editor to build 3D levels for games like this. It's easy and I use Tiled for all of my 2D game projects. A game like this is basically just 2D presented in 3D so Tiled would be perfect.

I keep things simple though so I never built or use any Tiled tmx map loader in AGK2. That seemed like just adding a bunch of overhead that was not necessary in my opinion. I just copy the map data sections from of the tmx file and paste those into a text file and I load that data in from that simple text file.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 5th Feb 2018 04:34 Edited at: 5th Feb 2018 15:32
Okay, so tonight I started building the game world using the free (Windows/MAC/Linux) Tiled 2D Map Editor.

Here is a gif... and I will briefly describe what is going on in each frame and then provide more detail on how I build the levels (and entire game worlds) in my game projects.


There are 6 frames in this animation. The first frame is the distant view showing the full map size (and the area that is detailed in looks very small).


How I Use 2D Map Editors In Game Development


Frame 1: View of Full Game World

I did not bother to build the outer wall all around the game world only two sides which is enough to show its overall area.

What I typically do is create a single map to represent the entire game world and inside that single map there will be multiple areas (or levels as we often call them).

Let me say that I think 2D Map Editors are a wonderful thing truly one of the best data structures ever devised for building games. They are super easy & fast to work with and near unlimited in just how much stuff we can use them for.

The key is to use layers. And we will take a look at each of the layers shown in frames 3, 4, 5 and 6 below.

And the other key is to just make some tile images that represent each unique object in your game world.

I use a combination of color coding and numbers and sometimes also use a one letter prefix. It doesn't really matter as long as they make sense to you.

Note: These tile images are only used when designing your game world in a 2D Map Editor. They are not actually used in the execution of the game. These tiles represent the various things that are needed in your game world including meta data that will never actually appear in the game as an object.



Frame 2: Zoomed in View of One Area in the Game World

Here we can see an area that has been filled out with floor, walls and ceiling. You cannot actually see the floors (or the marker for where the player starts and the direction they should be facing) because they are on a lower layer.



Frame 3: The Floor Layer

Here we see the floor of our area. For these markers I created images with the text F1, F2, F3 and F4 meaning there are 4 distinct floor tiles available.

I only used 3 of these when building the level because, as you may recall from previous posts above, I only made 3 floor textures. F1 represents txtFloor0.png, F2 = txtFloor1.png and F3 = txtFloor2.png.



Frame 4: The Walls / Interactive Layer

This layer holds the walls. We can actually structure our tile maps anyway we like and often I have a separate layer that holds enemies & collectibles, etc.

Here we are keeping things simple so this single layer will be used for walls, the player start marker, doors, enemies, collectibles and so on.

For walls I created images w1, w2, w3 and w4. These work the same as the floor markers only the represent they wall textures. w1 represents txtWall0png, w2 represents txtWall1png, w3 represents txtWall2png,

For the player start position marker I created 4 images with the text PS and drew an arrow on top pointing in the direction they should be facing. Here we can see the location the player is to be positioned at and we can see they are to be facing up (which in our 3D conversion just means they are facing at angle=0.



Frame 5: The Ceiling Layer

This layer holds the ceiling.

For ceilings I created images c1, c2, c3 and c4. These work the same as the floor and wall markers only they represent the floor textures. c1 represents txtCeiling0.png, c2 represents txtCeiling1.png and c3 represents txtCeiling2.png.



Frame 6: The Area Layer

This layer defines each area in the full game world.

For these I created images with the text 01, 02, 03 and 04 meaning at this point we could define 4 different areas in our game world.

We can see the one area that has been detailed in the map is Area 1 (the tile marker used to defined its boundaries has the text 01).



So... how does it all work?

Simple really... we already have a WorldMap 3 dimensional array. 1 dimension is for layers and the other 2 are for the x and z space.

Currently, our map is defined inside the program in a string variable. This string is parsed and the data is loaded into the array. 3D cubes are created based on this data and positioned in 3D space creating our 3D level.

So all we need to do is load the data from this 2D map into our program and process it in the same way filling our WorldMap.

Floor data will go into the [0][x][z]
Walls/Objects data will be loaded into [1][x][z]
Ceiling data will be stored in [2][x][z]
Area data will be loaded into [3][x][z] ... yes, we will need to increase our WorldMap array to hold this new layer.

Area data will be processed as follows:

We will create a type TArea and this will hold the x and z upper left corners and either the width and height or the x & z of the bottom right corner.
We will create an array of these types.
Layer 3 (Areas) in our WorldMap array will be scanned and we will populate this array of TAreas accordingly.

I hope this helps you to see how and why I use 2D Map Editors so much in my game dev. We can use them for basically everything we need.

For example, in other projects I have added layers to indicate the new area the player will enter when passing through an exit in a different area.
The limit is basically your imagination.

You could even have one or more layers that define waypoints / paths for enemies to move on and so forth.

Hopefully this helps someone.

The next release of the code here will implement the process described above to load the worldmap data from a text file, scan the walls layer to find the position the player starts and their rotation and so forth.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Lance
20
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 5th Feb 2018 15:08 Edited at: 5th Feb 2018 15:08
GarBenjamin :

Using Tiled looks to be the way to go ; Nice explanation on how you are using Tiled ... This whole tutorial should help all the new AppGameKit users ( including me ) .

Lance
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 6th Feb 2018 00:05 Edited at: 6th Feb 2018 00:06
@Lance Thanks. I hope it is helpful or at least interesting to people.

I'll do another update to implement the Tiled world map sometime this week and release the code here once again.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Conjured Entertainment
AGK Developer
18
Years of Service
User Offline
Joined: 12th Sep 2005
Location: Nirvana
Posted: 6th Feb 2018 14:23
@GarBenjamin
Looking great so far.

@Cliff
The 3d editor looks great too.

Coding things my way since 1981 -- Currently using AppGameKit V2 Tier 1
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 6th Feb 2018 15:45 Edited at: 6th Feb 2018 15:46
Thanks @Conjured

Either tonight or tomorrow I will do the update for using Tiled to build the full world and areas within that world.

I like my personal projects like this to be at a very relaxed easy going pace. Probably due to a career of dealing with deadlines at day job. See no reason to introduce same stress into personal life.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 7th Feb 2018 03:16 Edited at: 7th Feb 2018 03:21
Now our game world is defined inside the 2D Tiled Map Editor.

I added a very simple long hallway as a second area.


The new Area #2 is on the bottom right of the map. As you might be able to see the player start marker is on the right end of this long hallway and is set to have the player facing to the left (270 degrees of rotation).

And when you run this version you can press T to teleport between these two areas. Obviously this wouldn't be the way we'd connect the areas normally but I thought it was an interesting way to show that it does indeed work as I explained in my post above to easily define different areas right inside the overall game world map in Tiled.

And here is a gif animation of me testing the teleportation


Now we have finally truly reached the point where we can get on with this and start adding some real gameplay.

As usual source (we are at 20KB now) is attached to this post. Hopefully everything is documented well enough to be easily understood.

The Tiled.tmx map and the tiles used to build the game world are included in the source. They are inside the media/WorldMap folder. "WorldMapOnlyForDesigning.tmx" is the Tiled map where you build the game world. "WorldMap.txt" is the resulting text file that contains only the data we need (just the layers CSV data section copied over) the program actually uses.

The Tiled 2D Map Editor is free for Windows/MAC/Linux.


I hope you will come away from this update seeing how easy it is to build something like this (and many different kinds of games in fact) if you use a 2D Map Editor. And hopefully you might even find yourself thinking about tile maps in a whole different way and have some interesting ideas you want to try out. Remember, you can store anything... any kind of visual or meta data you need... inside a 2D tile map. Use layers and create tile markers as needed.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)

Attachments

Login to view attachments
Lance
20
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 7th Feb 2018 23:48


Looking better with every update . Would be nice to see this project included in the AppGameKit Examples or Projects folder as a good example for those starting out in programming and also for others to see how other programmers 'Do their thing' .

Lance
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 8th Feb 2018 02:07 Edited at: 8th Feb 2018 03:05
Thanks @Lance. It is good that at least one person finds this worthwhile. LOL Seriously, I appreciate that a lot!

Things You Can Experiment With

Not sure if you have played around with the source of the last build but some things to try is adjusting the MAP_TILE_WIDTH, MAP_TILE_HEIGHT and MAP_TILE_DEPTH values. For example you can double the height of the tiles and see how that changes the world view.

Of course using Tiled can experiment moving the player start positions around to different locations in each area or even redesigning one or both of the areas. You just have to remember to copy each section of the layer data out of the .tmx file and paste it into the appropriate place overwriting the existing data in the WorldMap.txt file to actually see the changes appear "in game".


What Is Next

I made one little update since that last version but that was tiny. Just added 4 position modifier tiles to the tile sheet. Basically in Area #1 I did not like it that the player was not centered horizontally between the walls. This is because that beginning hall is 2 units (tiles/cubes) wide and the player is positioned on the left of the two possible cells. Now any objects placed can also have one of 4 position modifiers placed adjacent to them (up, right, down or left of the object's marker) and in this case I stuck a modifier tile to the right of the player start position marker in the first area that adjusts the x-position by 1/2 unit to the right. So now they are centered.

I doubt if I will do it tonight but next on the list is to populate these areas with some static objects. They will simply be cubes and other primitives or combinations of these primitives. Representing tables, plants, etc. Basically representing whatever may be needed (and can be reskinned... again I see that stuff as something that can always be done later).

Getting some static objects into these areas will allow me to make sure the sliding collisions work well on these objects as well (it should). And then it will be in a good place to add an enemy that navigates the environment. Of course, if the enemy just followed paths then the objects would not be something they need to deal with anyway. But I generally like to make the enemies little virtual beings that explore their environment with certain goals in mind much as a person does. Not sure which way I will go. Maybe I will use a combo of predefined paths and roaming, engaging, fleeing, etc behaviors.

But that is after... first need some furniture and other stuff in this place.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
hoyoyo80
7
Years of Service
User Offline
Joined: 11th May 2016
Location:
Posted: 8th Feb 2018 05:55 Edited at: 8th Feb 2018 05:56
Just want to share if this can be use in this kind of project. Its a 3d tilemap addon for blender;

https://youtu.be/-ezYZgMp-R0

Look like a good tool for this type and also 3d game that want pixel art look.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 8th Feb 2018 17:41 Edited at: 8th Feb 2018 17:43
@hoyoyo80 Thanks for dropping in! I am not familiar with it at all. The only thing I use Blender for is making simple 3D models. Well I did make a model that served as a level in Blender for an experiment I did in Unity once.

I much prefer using a 2D Map Editor or even just using images to design the game worlds over 3d modeling software. Just find the workflows a lot easier and faster in a 2D map editor for this kind of game world.

It does look interesting though. Would need to experiment to see how to add in meta data (adding collectibles, enemies, spawners and so forth). The reason I am going with 2D Map Editor is I have worked all of this out long ago and done it countless times since so it is dead simple.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 8th Feb 2018 19:10
i simply imagened the 3d plane as a flipped 2d plane with a grid and pull up cubes or down and texture them on my editor.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 10th Feb 2018 05:08 Edited at: 10th Feb 2018 05:10
Just a quick post to say I have done some more work on this. Have the static object tile data loading and populating the world.
Knocked out some real quick 3D models for these things. A table, a chair and a statue. Updated the tilesheet with some new markers for these and added these to the Tiled map and "exported" to the text file used by the program.

The two rooms that are directly across from each other...


Area 2 is now a Hall of Statues


I won't waste time adding many more objects since this is all just for example purposes.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Lance
20
Years of Service
User Offline
Joined: 22nd Jul 2003
Location: Third planet from Sun
Posted: 10th Feb 2018 15:39


Really looking good .
Lance
puzzler2018
User Banned
Posted: 10th Feb 2018 21:34
Impressive little dungeon game of which we all used to love and certainly will make new agk comers program with ease

great impressive work so far

keep it up
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 10th Feb 2018 23:44 Edited at: 10th Feb 2018 23:52
@Lance and @puzzler2018 Thanks a lot. I appreciate it!

I am trying to just take my time and work on this a bit here and there and mainly not add too much stuff between updates so anyone who follows along can easily see what was changed.

So I think I will be releasing the next update very soon.

I was thinking about adding one more object type and thought well... instead of just adding another object like a crate or a chest or something why not add a static object that has some other purpose. And since I have said many times it is easy to work on the "looks" part at any time (and much better to wait til the end in my opinion) I thought why not add some mounted wall lights that are actually lights.

So now this system supports lights. I do need to adjust the light container rotation I forgot to do that. But that is easy enough. Just for lights running on z need to be y-rotated 90 degrees.










Looks pretty cool doesn't it for being so simple. Area #2 looks kind of spooky which is what I was going for thinking enemies hiding on the other sides of the statues waiting to pounce would be fun.

Of course, I was originally thinking of mounted torches but figured this was close enough to illustrate the point. Torches would take more time. Probably have a semi-transpared cube with an animated texture for the fire in that case.

And again it is all as simple as adding a tile representing a light where you want to add it in in the new Lights layer. There are two types... lights for horizontal walls and lights for vertical walls. With the idea being when you click to put a light one light will be created on each side of the wall at the spot if possible. If one of the lights would end up on the outside of the outermost wall (i.e. outside the current area) then it is not created.

I must say I am very impressed with the incredible ease of AGK2. I used to find this kind of thing a pain in the ass so tedious in Unity that I just never even bothered beyond a few experiments. Never used lighting in any game project I finished in Unity. I know other people over there really seem to have no problem with it but for me this was just so dead simple in AGK2 in comparison it is amazing really.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Cliff Mellangard 3DEGS
Developer
18
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 10th Feb 2018 23:53
Looks nice gar
Iam taking a small pixelstein break with a smaller Project right now
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 11th Feb 2018 02:36
Thanks @Cliff. Looking forward to seeing a screenshot when you get to that point.

I kind of do the same. Never liked projects that drag on a long time. I get enough of those at my day job. So I like to keep personal projects tiny scope or at the least like you are doing take a break and work on something else for a while.

Anyway good luck!
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 11th Feb 2018 05:18 Edited at: 11th Feb 2018 05:41
Alright back with the next update of the code. The project is at 34 KB now but that is the result of including both the Tiled tmx map for you to edit and so forth as you see fit as well as the new object models.

I added some images to the tilesheet and code to support modifying the positions of an object by 1/2 of a unit (i.e. 1/2 x or z distance) and this is used to center the player on x in Area #1 now.
New images have been added to the tile sheet to represent static objects: a table, a chair and a statue.
Created some simple low poly models for the table, chair and statue. These are inside the new Models folder.
A new layer has been added to the Tiled WorldMap for lights. 2 new images were added to the tile sheet for placing lights on walls running horizontally or vertically.

MapManager has been updated with support for the Static Objects and the Static Object Lights.

I also added a slight camera bob up and down motion. Very subtle but it makes a difference.



I think everything should be fairly well commented and reasonably clean code but if anyone ever has a question about how something works feel free to ask.
BTW the point of all of this is not me saying this is how ya do it. Only this way. LOL
Just saying this is one way to fairly easily do such a game. It is the way I would approach it making use of tile map data as much as I can.
Also there are sure to be optimization opportunities but this is not something I have paid any attention to other than a bit of thought during the basic design of it all. I much prefer code clarity first and foremost and focused optimization comes only when the need shows up.

Next time I work on this I will probably add either collectibles, enemies or casting some fireballs around;

Source is attached to his post.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)

Attachments

Login to view attachments
Sph!nx
15
Years of Service
User Offline
Joined: 3rd Dec 2008
Location: The Netherlands
Posted: 12th Feb 2018 17:25
Nice work, mate. Thanks for sharing as well!
Regards Sph!nx
hendron
8
Years of Service
User Offline
Joined: 20th Dec 2015
Location:
Posted: 12th Feb 2018 19:14
Hey GarBenjamin, nice looking project you have going here. I'm a fan of this kind of old school inspired stuff, so I look forward to seeing where it goes. Thanks for sharing your code too, it's always cool to see how other developers work.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 12th Feb 2018 19:31
Thanks Sph!nx and hendron. Glad you two appreciate it!

I will be putting up another update tonight which has some clean-up. Using a single texture image and sub images of solid colors for the walls, floors, ceiling, objects and so forth.

An update to the lights and a bit of code clean-up.

Also, I decided to waste some time again and create a second texture image that actually has textures although I have not UV unwrapped the simple poly models and textured properly based on that. Didn't see the sense in wasting time on that at this point.

I am, however, thinking I will add some occasional flicker to some of the lights.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
kaband
20
Years of Service
User Offline
Joined: 22nd May 2003
Location: Chicago
Posted: 13th Feb 2018 01:38
GarBenjamin, this looks awesome. I really like it. Great stuff. Old school RPG feel.

I love your computer path too.

TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)

Its the same one I took (computer wise). I started with a TI/994a and one of my favorite games of all time was Tunnels of Doom which used that First Person perspective, but only when traveling between rooms.
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 13th Feb 2018 03:35 Edited at: 13th Feb 2018 03:45
Hey Kaband thanks! And I remember Tunnels of Doom. In fact, I came across a remake project of it a year or two ago. Not sure if it was ever completed but I thought that it was interesting to see someone working on it! Just did a quick search and I guess maybe he completed it: Tunnels of Doom Reboot.

Alright... enough playing around with graphics and FX. I do this kind of thing to break up the game development I think. I generally put the priority on working on the actual gameplay stuff and systems and such to bring the world to life. But it is fun to mess around with visual stuff like this. So I guess it is like taking a break in a way. lol

Anyway... now there are 3 different kinds of lights. Well they are all the same basic light but can be normal always on or styled in one of two ways...

Glowing (sci-fi ALERT style)


Flickering (which could be used for sci-fi or adjusted for the flicker of a mounted torch on the wall in a dungeon)
The flicker FX didn't come out as good in the gif but you get the idea I am sure.


Yeah they are tiny gifs. I did that just to keep the size down so this page of posts doesn't take a long time to load.

I added some glowing lights to only the first area and some flickering lights only to the second area. Like I mentioned before I textured it all again just for the fun of it. But I will include the original texture image that has solid colors as before as well.

I'll get the code up either later or more likely tomorrow. Had enough time working on the computer.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)

Login to post a reply

Server time is: 2024-04-23 16:26:12
Your offset time is: 2024-04-23 16:26:12