Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 18, 2024, 04:27:50 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsSpaceHero Command
Pages: 1 [2] 3 4 ... 43
Print
Author Topic: SpaceHero Command  (Read 105184 times)
happymonster
Level 10
*****



View Profile WWW
« Reply #20 on: December 14, 2011, 11:58:52 AM »

Set'ing things up

When I was at school one of the crazes was to collect Panini stickers, whether that was the 86 world cup squads or those scary cabbage patch dolls. Panini were really evil in that you had to collect everyone in a squad (for the footballers), so you might have everyone apart from the third choice dodgy goalkeeper.

What has this to do with the game? Well, not too much apart from the fact that objects in the game will also be arranged in groups, or sets of objects. So for example, there will be a set for one particular unit, while the actual level graphics (walls, floors, objects, etc..) might be in another set entirely.

The advantages of doing this is that it makes it easier to keep things grouped together and not have one massive list of objects and an equally large image file. It also means we can unload graphics that are not being used and load in only those sets that we need to use to build a level.

For the game, there will be a maximum of 256 different sets (each with it's own unique identity number). Within each set there is a maximum of 256 different objects. This means that for the map, two bytes can store any object in the game and we can have upto 65535 objects on a map. In comparison maps in Xcom only have a maximum of 256 objects. Smiley

Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #21 on: December 15, 2011, 01:37:25 PM »

Into the Forth Dimension

Currently the maps are stored in a 4 dimensional array, of which the dimension are: X, Y, Layers, Level

X and Y are the pretty normal dimensions for describing a 2D map. Layers holds the various layers of objects for each object tile. Finally Level holds the current floor level of the map (think of multi-level buildings, or heights as in X-Com)

Currently there are 5 layers, which consist of: Floor, Shadow, Object, Units and Ovelap.

- Floor is used for floor graphics, and anything which is slow to walk through, etc.
- Shadows is used for any shadow graphics and normally darkens any floor tile in various shapes.
- Object is used for walls, furniture, and anything that can be walked over on the floor like dropped weapons, bodies.
- Units holds the information for your units and enemy / independent units. As these can walk over some objects they need to be on a separate layer.
- Overlap is for any overlapping objects or graphics such as the tops of walls overlapping the bottom part of an object or unit graphic.

I might need to add in more layers as the game progresses, but that shouldn't cause any real difficulties as the layers are all referred to by the use of C #defines. This means that I can move them around and insert new ones without breaking very much!

I've been busy this week with social and work commitments. I should get more time this weekend to start work on the map editor. Smiley

Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #22 on: December 17, 2011, 10:27:40 AM »

Annoyed!

Well, I was supposed to be working on the map editor today.. After implementing a nice mouse cursor I found a strange technical bug with the engine that I've spent most of the afternoon trying to track down with no success!

That has not been enjoyable, and I'm going to leave it for now to actually get some of the map editor started..  Lips Sealed
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #23 on: December 17, 2011, 12:44:26 PM »

Fixed it! (almost by accident)

And it wasn't even my fault, but an engine bug..  Facepalm
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #24 on: December 18, 2011, 01:58:17 AM »

Sim Wall

Hurrah! I got a lot done on the map editor in the end yesterday. Now I can draw walls across a map like a drunken builder and the editor will automatically sort out changing the graphics so the walls all connect up correctly. It will also add the right shadows as well. Smiley

This is how the editor works so far.. The screen is composed of 16 x 12 tiles - but in map editor mode the viewable map area is restricted to 12 x 12. The remaining 4 x 12 area on the right becomes the map editor panel and is devoted to showing all the map Sets you can use.

For example at the moment there are only three, the walls/floor basic Set, the player units, and an enemy unit. If you click on a Set the map editor area changes to show all the selectable tiles within the Set. You can then select the one you want to use and draw on the map area. Right mouse button erases the tiles. If you right click in the map editor panel it changes back to show the Sets available again.

So in effect it's a way to select any tile by the group it's in, rather than having them all mixed up in one massive list.

It works well so far, very quick, and it's easy just to draw walls, and then add player and enemy units.

I need to deal with scrolling and saving/loading maps next.  Gentleman
Logged
eobet
Level 4
****


8-bit childhood


View Profile WWW
« Reply #25 on: December 18, 2011, 03:10:35 AM »

Did you ever play Laser Squad Nemesis?
Logged

happymonster
Level 10
*****



View Profile WWW
« Reply #26 on: December 18, 2011, 03:21:52 AM »

Yes I did, but I never liked it.  Wink
Logged
DrDerekDoctors
THE ARSEHAMMER
Level 8
******



View Profile WWW
« Reply #27 on: December 18, 2011, 03:42:36 AM »

Yes I did, but I never liked it.  Wink

High-five!
Logged

Me, David Williamson and Mark Foster do an Indie Games podcast. Give it a listen. And then I'll send you an apology.
http://pigignorant.com/
Yodhe
Level 0
***


Flying Lasanga


View Profile
« Reply #28 on: December 18, 2011, 04:50:44 AM »

I never played X-Com, and thesedays I never have the time to play games much, due to small children demanding parental attention.
But I am looking forward to maybe breaking a habit for this game. :D
Logged

Bunker Mentality - Post Apocalyptic Squad Turn Based Strategy RPG - http://www.justanotherturn.com
happymonster
Level 10
*****



View Profile WWW
« Reply #29 on: December 18, 2011, 04:53:52 AM »

Thanks Yodhe. Smiley

DrDerekDoctors: Yes, I never know quite what it was about Laser Squad Nemesis, but it never felt right to me. I didn't like the generic units and lack of names as well. It all seemed a little soul-less compared to their other games as well.
Logged
eobet
Level 4
****


8-bit childhood


View Profile WWW
« Reply #30 on: December 18, 2011, 05:01:19 AM »

Yes I did, but I never liked it.  Wink

High-five!

Wait, what, why? The match making and interface did suck, but what was wrong with the game itself?
Logged

DrDerekDoctors
THE ARSEHAMMER
Level 8
******



View Profile WWW
« Reply #31 on: December 18, 2011, 05:25:39 AM »

Just don't like that format of strategy game, with the simultaneous moving. I like literal turn-based stuff.
Logged

Me, David Williamson and Mark Foster do an Indie Games podcast. Give it a listen. And then I'll send you an apology.
http://pigignorant.com/
happymonster
Level 10
*****



View Profile WWW
« Reply #32 on: December 18, 2011, 07:18:47 AM »

Neither do I, so don't expect to see any of that new fangled simultaneous moving! Let's have good old British turns where we all respect one another properly and do everything in the correct orderly manner!
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #33 on: December 19, 2011, 10:58:32 AM »

It Scrolls! (Don't sue me..)

Ok, now we can scroll the map around using either the arrow keys or the right mouse button and panning around. I will have to implement some reverse direction panning. It just feels more natural to me to move the mouse in the direction you want to scroll in, rather than the opposite as with Google Maps.

In implementing the scrolling, I realised that it didn't look as smooth as it should and so I've implemented smoothing factors to the movement. However it still wasn't as smooth as I wanted so I've done a big rewrite of some of the engine code. Now, if I have no other programs running (Browser, Email client, etc..) I get a quite solid 120fps at 1280 x 960. Not sure what else I can do to make things smoother when other programs are running and dropping the frame rate at irregular intervals though.

I'll see if I can improve things a bit more and then I want to look at auto-loading and saving of maps. Smiley
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #34 on: December 19, 2011, 02:45:49 PM »

Ohh.. I think I've addled my brain by trying different ways to improve the scrolling. Now my eyes hurt and the world keeps moving!  Epileptic

Time to take a break for tonight!!  Facepalm
Logged
happymonster
Level 10
*****



View Profile WWW
« Reply #35 on: December 20, 2011, 12:54:55 PM »

I'm currently thinking of saving the maps without any kind of encryption or anything like that. Although I'll probably use compression via gzip, but would like it be easy for maps to be externally modified if people want to. I don't think it matters for this kind of game if people change things in the maps..

What do you think?
Logged
negativeview
Level 0
***


View Profile
« Reply #36 on: December 20, 2011, 01:56:48 PM »

Definitely allow the player to modify to their hearts desire in single player. Without the relatively easy ability to make world editing tools and such, entire sections of the Minecraft community would never have formed. In multiplayer there's a valid reason to restrict it, in singleplayer, not so much. If players want to cheat themselves out of the game... meh.
Logged

happymonster
Level 10
*****



View Profile WWW
« Reply #37 on: December 20, 2011, 02:30:52 PM »

That's what I think too. Really the file sizes for maps won't be massive even without compression. It might be easier just to have them as easy to modify as possible if people want to do that.
Logged
DrDerekDoctors
THE ARSEHAMMER
Level 8
******



View Profile WWW
« Reply #38 on: December 21, 2011, 04:19:46 AM »

Definitely allow user modding! In fact if your editor is nice, I say include it. I remember me and my mate James writing editors for Laser Squad and Lords Of Chaos on the SAM Coupé which poked into the emulation snapshot. Smiley
Logged

Me, David Williamson and Mark Foster do an Indie Games podcast. Give it a listen. And then I'll send you an apology.
http://pigignorant.com/
happymonster
Level 10
*****



View Profile WWW
« Reply #39 on: December 21, 2011, 01:33:59 PM »

Oh I do intend to include it. It's always nice to be able to make your own maps and edit games. Smiley

My main job has been very busy lately, but from tomorrow onwards it should be quieter than I have more mental energy for programming and drawing the graphics.  Tired

In the meantime I've still been mulling over different ideas in my head.
Logged
Pages: 1 [2] 3 4 ... 43
Print
Jump to:  

Theme orange-lt created by panic