PDA

View Full Version : Graphical capabilities



void
08-04-2009, 05:19 PM
I've been poking at a few engines for doing some indie game dev stuff for a while, and Novashell looks interesting, but I have some concerns about visual effects.

I definitely want a 2d gameplay, and would be happy with 'mostly' 2d graphics, but I was hoping to be able to do some tricks with polygons to fake 3d here and there, as well as do screen space masking.

The game concept I'm looking out would be top-down action, ala SmashTV, Geometry Wars, and similar styles of games... but I want some additional elements to better support a sort of survival horror feel. This includes line of sight obstructions.

I was looking at your scripting reference, and I see you already have some functions for drawing lines and rectangles. Would this be difficult to extend to filled triangles? That would be enough to properly provide opaque and translucent visual obstruction masking.

I was also intending a city-style environment, so being able to put up billboards of walls would be useful. This would be easy enough to fake with proper rotation/skewed scaling, but it isn't clear if these functions are properly available just at the initial glance. It would be simpler if we could simply map a 2d graphic to have certain screenspace x/y coordinates four all four corners independently. The necessary math for skewing to fake 3d is pretty straightforward.

Of course, for either of these tricks to work properly, there needs to be precise control of when the display is updated. Does the display update per tick only, as functions are called, or configurably between the two?

Thanks for your time.

Seth
08-05-2009, 05:25 AM
Hi void,

Hmm... It IS possible to insert your own GL rendering into the pipeline but it does require doing it on the C++ side of the engine.


Does the display update per tick only, as functions are called, or configurably between the two?


The draw all happens during the Render() command, which is totally decoupled from the game logic.

If you create a C++ TileEntity, its Render() will get called according to its layer, which handles the visual sorting. (See my PC game Mind Wall, you can download the source and see I just made a C++ entity to handle all the 3D, then I plopped it on a layer and controlled it using lua script)

Or, you could just hack in a place to butt in and do GL calls at any point in the render code if you wanted. (C++ hacking)

On the subject of adding line of sight support, this sounds like a real headache if you were trying to get it to work with the existing wall/pathing system.

Well, unless it was just for creatures, then it would be easy as there is a IsEntityInMyLineOfSight() function.

But I assume you want darkness, and have it smart enough to darken rooms when the door is shut, etc. I didn't include any support for that kind of stuff as is, so it might make sense to just start from scratch with your own map/room format optimized for that.

void
08-05-2009, 06:20 AM
Hi void,

Hmm... It IS possible to insert your own GL rendering into the pipeline but it does require doing it on the C++ side of the engine.

The draw all happens during the Render() command, which is totally decoupled from the game logic.

If you create a C++ TileEntity, its Render() will get called according to its layer, which handles the visual sorting. (See my PC game Mind Wall, you can download the source and see I just made a C++ entity to handle all the 3D, then I plopped it on a layer and controlled it using lua script)

Or, you could just hack in a place to butt in and do GL calls at any point in the render code if you wanted. (C++ hacking)

On the subject of adding line of sight support, this sounds like a real headache if you were trying to get it to work with the existing wall/pathing system.

Well, unless it was just for creatures, then it would be easy as there is a IsEntityInMyLineOfSight() function.

But I assume you want darkness, and have it smart enough to darken rooms when the door is shut, etc. I didn't include any support for that kind of stuff as is, so it might make sense to just start from scratch with your own map/room format optimized for that.

Unfortunately, my capacity for working with low level graphics and complex C++ is pretty limited. I'll have to consider this.

A point of clarification: my intent for line of sight was more for player view, to black out what the player cannot see in realtime. Hence my interest in a filledtri graphics function. From a top-down viewpoint, it wouldn't be too difficult to calculate which tiles are forming blocking edges, and black out everything behind them in radial lines using triangles, although I don't really know how expensive that would be.

Being able to do this with multiple levels of alpha would also allow one to distinguish between hard visual barriers and minor obstructions.

For instance, a building would be a hard barrier beyond which everything could be opaque black, but a car would be a 'soft' barrier beyond which everything would be translucent black. This would represent a space where you can see terrain, but not be guaranteed to have enemy presence or movement be visible.

In short, I'd like to achieve realtime line of sight based fog of war.

Obviously, this is a longer term development objective, but it'd be nice to know if this is reasonably feasible before I put too much effort into building up the basics.

Edit: I'm unable to locate the source for Mind Wall. I checked the iPhone post, as well as the Win/Mac post (just downloaded the mac version, going to play with it. I'm intrigued by the video I saw). Could you help me track that down?