Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

150 Neutral

About smokyturbo

  • Rank

Personal Information

  • Interests
  1. Thank you both for the replies and for going to so much effort regarding the code snippets etc, really appreciate it. I like the idea of the back-and-forth to keep the building logic away from the render layer. My camera is currently in the render layer at the moment and thus ATM the logic layer wouldn't know how to convert the mouse position to a world position. I'll have a think about either moving the camera into the logic layer (maybe by becoming an actor like other game entities) or maybe I could abstract the mouse events in the render layer into build/preview requests received by the logic layer.
  2. Hi all, I'm making a little prototype for a tile-based RTS just for fun and I'm having some problems structuring the UI side of things. There's several problems in my head at the moment, but I'll avoid putting them all into one post for now. I'm using an ECS, and so my game logic is separate from my rendering logic (I have a RenderSystem which draws the map). The render system has the camera for converting from world->screen coordinates and knows which sprite to draw for each tile. The render system also has a UI (a sidebar like the C&C games etc). This consists of the traditional tree structure of View classes like Buttons, TextViews etc. When the user selects a building (via a button) from the sidebar, with a view to placing it on the map, I'm not sure how to handle this. Showing a preview of the building at the position of the mouse cursor (with green tiles for valid placement, red for invalid) requires knowledge that only the logic can know (which tiles can this type of building be placed on, has the player got enough money etc). How best for the render system to retrieve this information? Any thought welcome, thanks in advance to any who reply.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!