Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!

1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Member Since 26 Mar 2008
Offline Last Active Aug 13 2014 12:59 AM

Topics I've Started

rotating sprites and entities using XNA

18 July 2014 - 03:27 PM

Ok, so I started making this 2D top-down game using C# and XNA (because I am really familiar with C# and not famliar with game development). I am using the Entity / Component / System pattern and everything has been great so far. But now things are getting a little tricky so I was hoping people here could give me some tips and pointers.


As mentioned, my system is based on Entities that work as holders for a set of Components, some very simple ones like Spatial (takes a Vector2 as a position), Collider (sets a hitbox relative to the spatial component). Others are a bit more advanced like a door. The door can disable the Collider when the door is open, and rotate the sprite over time to make it seem like the door is opening.


I am having issues because I wanted to rotate the door to an angle (0, 90, 180, 270) to be able to have doors on all sides of houses, but this is a problem because of the origin being set to (0,0). All my sprites are using 0,0 as origin and I am thinking if this was a dumb choice. Maybe I should always set Origin to the center of the object.


So there is my question, when people build games like my 2D top-down game, do they set Origin to the center of the sprite and rotate, or should I create 4 unique doors, each one facing a certain direction?


I have added screenshots of my doors open and closed if that is better.


Organizing a map structure for a top-down tile game

06 July 2014 - 11:23 AM

As the topic states I am trying to write a  top-down tile-based game, something like RimWorld or Prison Architect. Where the player can manipulate the world in different ways.

But before I just go ahead and start writing code I am trying to decide on the structure of the world. There are multiple ways of dealing with this I know, but maybe someone can put me on the right track.


For one option I was thinking of having a two-dimensional array of Tile objects

Each tile has a position as well as having a collection of Entities.

Each entity having a position and rotation relative to the Tile as well as a texture to draw. This way I can find a tile instance from the Map, add a table, and put a vase on top if it very easily.


To draw I would just call Tile.Draw() and it would draw all it's entities.


I see alot of advantages with this approach, like I only have to check if the Tile is on screen before I draw it. Plus it's really easy to detect what items the user wants to manipulate.


On the downside it makes it harder to place bigger entities, like a table that spans 2x4 tiles, Especially if the player can move/place/remove items in the world.


What other ways are good? I could keep a big list of entities, maybe grouped by position, so for each 25x25 tiles I will have one list containing everything in that area. But again I would have to keep in mind some items may span multiple areas.


It all ends with me being confused as to what is the best/a good/an acceptable way to store and manipulate a world where everything can be moved, rotated, removed and added smile.png And when I am confused I get unproductive.


I have been trying to google but I guess I keep searching for the wrong keywords, because I can't find much usefull information. So any hints and pointers are very welcome.

Simulating units 'flooding' a door

08 May 2013 - 06:04 AM

Im working on a small Tower Defence kinda game with a little twist, all of the enemy units will be released at once and it's upto the player to constrict their numbers into tunnels. 


Of course I started with all the easy parts like towers and stuff but now I have to write the logic for crowd management, and I am abit unsure if there are any good algorithms for this?


Quick example...


Attached File  queue.png   2.05KB   26 downloads


Here is 8 units trying to squeeze though a door which only allows one unit at a time.


I have already created a A* grid so I know where they are supposed to go, but it's the queue principle im struggling with.


Appretiate all the help.

When to start planning Kickstarter

17 September 2012 - 06:18 AM

Hi guys, open questions here.

When should I, ideally, start planning for a Kickstarter campaign?
I got a game planned, about the same size as FTL (www.ftlgame.com), and I feel this game has real potential, but I know myself, first of all I can't draw, neither can I produce music, so I need to hire someone do to all these things, and that takes money. I have starting developing the framework, as well as some decisions regarding 2D library, sound library.

But seeing all the other great ideas on Kickstarter (FTL, Castle Story, Project Eternity, Dead State just to mention a few) Im afraid I have to be near completion before I can even start considering using Kickstarter.

So it's a balance of what to plan, and what to actually finish before showing the game off to other people.
Also Im thinking a kickstarter campaign would be a greate idea to put pressure on myself to actually finish the game, having other people know, and wait for something Im making is a wonderful thing that shouldnt be underestimated.

So what says the people? How much of an demo, trailer do you need before you would consider pre-ordering a game? Spescially considering how easy I could be to just take the money and not release anything. And of course my name is completely unknown and that is an added liability.

Storing battleship data in a table

14 February 2012 - 08:07 AM

I am writing a small battleship clone in flash with multiplayer functionality and while designing I came across the fact of having to store the whole board for each game.

I need to store every 100 cells (10x10) for state (state includes x, y, ship, hit, miss), but ofc I don't want to have a table with 100 columns.

My first thought was to have a column with char(100), and then just write a long string with 100 values to that column.

That will work, but I wanted to run this issue here and see if there is a better, smarter way to do this...

Thanks in advance guys