Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 21 Dec 2012
Offline Last Active Yesterday, 09:56 PM

Topics I've Started

Lighting a 2D RPG, tile-based, top-down game. So confused.

19 November 2015 - 04:51 PM

Hey all.


I have my own editor (Direct2D) and engine, and its all coming along nicely. I now need to add lighting (and possibly later shadows), and after spending the whole day yesterday and today researching on google and reading articles on Gamedev, I'm 100% confused and unsure on how to proceed. I dont want to start on a path that will lead nowhere or make the engine slow to a crawl because of bad implementation.


My game is tile-based, and I would like to add several lighting effects, such as:


- objects emitting light (candles, torches, camp fires)

- global lighting (to have the whole screen appear with a blueish tint, for example)

- particles emitting light

- a light radius around the player

- each light source needs to modulate depending on other light source, if possible.


I read about using alpha bitmaps you draw on top of your objects and such, but I feel that this is an old technique that would be taxing if several "light maps" would be used. It also raises the question of Z-order of the tiles vs player vs lights and shadows, etc.


Then I read about shaders--which I have ZERO experience with--and seem like what I should be using to add lighting to my game.


I would welcome any suggestions, and I am starting the lighting system from scratch so whatever is the current norm is fine with me. I wish to stay with Direct2D if it is an option.


Are shaders the way to go? If so, are there any web/reading material focused on 2D I could read?


Thanks a lot! Sorry if this topic has been covered before, but none of what I found so far was helpful.


PS: As a reference, I am trying to accomplish something similar to how Delver's Drop does lighting to start with:




with a mix of he old Diablo games:




What theme do you use for your blog?

27 October 2015 - 09:06 PM

Hey all!


I have both Drupal and Wordpress install and I'm deciding on which one to use. I want to know what theme you guys would suggest for a programming blog. I find the default ones for both kinda boring, and going through Wordpress' pages and pages of similar themes got me nowhere.


I just want a theme that will make it easy for me to put pictures and code in my posts and have nice display.


You guys have any suggestion or positive experience with any themes in particular? Or even another platform besides Wordpress/Drupal, I'm open to anything.



How to cope with code in different languages?

24 October 2015 - 12:53 AM

Hi guys,


I wanted to get some idea on how to deal with a problem I created for myself over the last few months.


I started building small games a few years ago, trying to make perfect functional copies of Pong, Space Invaders, Pacman, etc. With each new project I built on top of the same little engine, adding more stuff, and retooling it with each new game. The engine is in C++ and using DirectX.


Now, my current project, on which I've been working for nearly a year, is an RPG and I started testing stuff and building an editor for it, but this time to test a few things out quickly, I used Delphi (Pascal language) which I've been using since 1995, and I'm pretty good at it. It builds user interfaces in the blink of an eye.


But as weeks went by, I added so much stuff that I built a very feature-rich editor (map, dialogue, combat, etc), all in Pascal, complete with unit tests for game logic. I did not intend to do any serious coding in Pascal, but it was so easy that I let myself believe it was all going to work out fine. It ain't.


So now I'm stuck with wanting to expand the engine in C++, but all my game code is in Pascal, and works properly. I have a massive number of Pascal files, covering everything from AI to maps to anything else you can think of. Except the actual "run-time", the engine itself.


I have a few options I thought of, most of them are problematic, so this is where I would appreciate some insights.


I can bite the bullet and convert everything to C++, but since the game isn't complete yet, that would mean so much work...


I can use DLLs to have the engine access the game logic, but object oriented and DLLs don't play well together I think, so that's another nightmare.


I can rewrite the engine part in Pascal, and have all the code play well together. While I love Delphi and Pascal, the IDE is fickle and the rarity of Pascal code in the industry would lock me out of a lot of what's out there in term of open source, etc.


I am pretty depressed about the hole I put myself in, and if anyone of you guys have dealt with multiple languages like this, be it Pascal, or whatever else, I would appreciate some advice.



Properly managing abilities/spells

10 July 2015 - 12:15 AM

Hi all,


I've been spending the last few days thinking on how to best implement the spells in the game I'm working on. This might or might not be a waste of time, but I want to make sure I dont design and code something that will cause me headaches later on.


Basically, most actions the user or AI performs in my game are "abilities" that are executed. Opening the map executes the OpenMapAbility::Execute(), moving on the battle map executes MoveAbility::Execute() and so forth.


My worry with this design is that while having the game actions performed by each of the abilities classes (inside their Execute() function), they require access to only part of the game core they modify/use, but I foresee a lot of maintenance using this system, as changes to the core game might require modifying tons and tons of classes in order to handle the changes.


Another way to do it would be to use a super class that takes as input the ability to cast, which seems like a better way to manage things, but then the class becomes very large, and instead of requiring just a few dependencies, it requires much more access to the game world.


I guess my question is, what would be the best way to manage a pretty extensive set of abilities/game actions, allowing for easy changes to be made, and given the fact that I quite inexperienced, I need to implement a system that wont be a nightmare.


Sorry for my not so amazing English, and thanks for any inputs, my searches on Google were of no help!



Slower ID3DXSprite:Draw() on non-aligned source rect position/size

25 January 2015 - 02:36 PM

I'm using DirectX 9 and ID3DXSprite to draw my graphics, and I was wondering if using ID3DXSprite:Draw() with a source rect that is not aligned on a specific boundary, or if the source rect has an odd or unaligned width would slow down the rendering.


I know this might have been an issue decades ago, but I am wondering is such issues might be lingering in DirectX 9 or on some video cards.


I tried to google that stuff, but I couldn't find anything definitive.


Thanks for any tips!