Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 16 Nov 2004
Offline Last Active Apr 17 2013 08:59 AM

Topics I've Started

RawInput, ascii and deadkey characters

30 January 2012 - 05:43 AM

RawInput seems to be what everyone suggests doing nowadays, got it up and running quite easily. Found some useful information to fix some of it issues and it's working really well for virtual keys now. The documentation was lacking and incorrect in some aspects it seems.

However, translating that into printable ascii characters turned out to be harder than I thought, and I still haven't found any implementation that actually works properly with deadkey characters, combining ` and u into ù if typed in that order. I have seemingly tried all combinations of ToAscii and GetKeyboardState, and everything in-between but can't find a solution that work 100%, and produces the correct results like WM_CHAR does.

WM_CHAR works for me, but it would be nice to only use RawInput for the input. Does anyone have an idea how to properly do this, or know of any existing project with source code that does this?

Controllable player character with Box2D

06 December 2011 - 04:10 PM

So I've been playing a bit with Box2D, the intention is to create a 2D physics platformer.

But I really can't figure out how to best control the player character via Box2D, I've look around the internet some and while there are some examples out there, all I can find are pretty crap and have major flaws or can't really be tweaked in any practical way. The idea is for the player character to have momentum, the world will have angled terrain that will slow down the movement a bit, and given steep enough angles the character should simply slip back down. The player should be able to drag and get pushed moving blocks. The player should not act like a vehicle but should stick to the ground. We definitely want to be able to tweak the feeling of the player character. The character feeling in LIMBO (http://www.youtube.c...h?v=t1vexQzA9Vk) is similar in nature to what we have in mind.

I've played with a dynamic body consisting of a sphere "leg", but it has rather erratic behavior, it will slide regardless of friction with no impulse applied when put on an angled surface. And sometimes it will instead get "stuck" on the very same surface instead, not sliding at all, but also not being able to go uphill. By simply going back and forth along some chain edges.

Of course I'm not expecting a solution, simply what "tools" I should use, there's something called kinematic bodies, but I can't really tell what they're actually meant for... it seems like I should be using dynamic bodies, or? I wouldn't really have an issue with just completely overriding the dynamic body physics for the player, but it must interact with the physics of the world to some degree; being "realistically" pushed by moving blocks (small ones should just bump you) and also be "realistically" affected when moving blocks (player should be affected by the momentum and weight of the block).

Any hints?

It's stripped of all graphics and such at the moment, and I doubt there's anything of interest to see (the player is the little sphere), but here it is anyway:

3D tool for parallax 2D side-view?

03 December 2011 - 06:58 AM

I'm currently looking into content tools for a game, the basic idea is a stylized 2D side scrolling platformer, with parallax (aka, different layers move at different speeds to simulate depth). This can obviously be done using quads in 3D too, which would also open up for more artistic freedom... my hope being that I could spend my time doing more important stuff than writing a complicated tool for it. We also have the need to be able to create basic animations which many 3D tools already have great tools for... I really wouldn't mind creating a tool for static geometry, but also implementing animation seems like quite the project.

So I'm curious if you guys know of any tools that would be well suited for this? (placing quads and doing animation)

I know Blender is free and hugely capable, but it's also seems hugely over-complicated for something like this... the artist has little to no 3D experience.

PS. It doesn't have to free, but it mustn't cost hundreds of dollars.

3D tool for making non-textured 2D sprites

05 August 2011 - 02:38 PM

I'm currently working on a game and I feel like I've come to the point where I want to have a go at the graphics and would need to have some decent sprites to work with to better get a feel for the style/atmosphere, and to of course get the renderer up and running and decide what techniques needs to be implemented for satisfactory visuals.

Anyway, to the point. Being the visual perfectionist that I am and the desire to avoid a lot of headache I have decided to stick with isometric 2D sprites... and I really enjoy the style in the animated Portal 2 trailers and feel like it's something that could work really well for my purpose, especially since it also pretty much avoids the textures entirely. I will also be requiring some simple (key-frame) animations.

What I mean:

Posted Image

However, I have only very little experience with 3D modelling tools and I'm not sure what tool would be best suited for my needs... that is, to be able to reproduce something similar to that style (again, no textures). I have played around quite a lot with Google SketchUp and could've been exactly what I was looking for... except that there's no light support and no way to export high quality images, or even transparent images... and no way to export other useful stuff either (normalmaps, etc). So it's really ends up being quite useless for my current purpose.

Do you guys have any hints on what I could use?
I'm a quick learner and would rather use a more competent tool than one that is barely capable of my "vision".

Blending colored light values, etc?

25 May 2011 - 05:35 PM

I'm currently developing a 2D game, the engine itself is meant to be rather simple in nature.

All terrain blocks and such are constrained to a simple fixed 2D grid, I've just implemented a crude form of real-time ambient occlusion, only white lights allowed, a light is assigned to a square in the grid, and the light propagates outwards to other squares from there, decreasing in intensity as it spreads... it works really well and was really rather simple to implement.

So I'm currently looking into supporting colored lights, and even pondering about trying my luck with color bleeding (having the color of the terrain influence the final light values slightly)... and an extension of that, have materials that can color light going through it (a white light source that shines through water will have a blue tint). Keep in mind that this is for a 2D-game, so correctness is not important, a pleasing end-result is the primary goal, in that context, I also assume that it is favorable to be able to maintain a bright environment (that is, one light should be able to fully light the immediate area around it)... perhaps I'll even add HDR just for the fun of it, could improve the feeling of the different environments and areas... although it could perhaps also make lighting a lot harder to work with.

But I'm quite literally rather lost when it comes to theory of color math and colorspaces, although I don't think I'll have any issues with the technical sides of it all.

How do you correctly blend light values?
Adding the RGB-values seems like it would exaggerate the final light too much.
- Two lights of equal brightness shouldn't produce a twice as "visually" bright light if put in the same spot? (use a logarithmic scale?)
Taking the maximum of the R/G/B-channels seems like a reasonable approach from a brightness-perspective, but from my experience, this messes up the color instead.
- 50% R + 50% G will yield 50% RG, whereas 50% RG + 50% G will still yield 50% RG.

It seems like one should treat luminance and color separately? Use some other color space?
Take the maximum brightness of the light values, and then do a weighted blend on the color values separately? What colorspace would you recommend for blending colors?

Generally I'm just looking for information on how to deal with colors and such, links, tutorials, anything that could provide some in-sight. If you have any ideas or hints I'd love to hear them.