You are not logged in.    Login    New User    Forum Home    Search

Location:
JBPLAY  \  Meteor 2  \  Suggestions  \  Darkness

Back to Threads

Viewing Thread: Darkness

 

Raaka-arska

Joined: 22 September 2003
Posts: 109
24 October 2004 19:54 (UK time)

I'm not sure if this has been suggested already,
but if there would be darness/field of vision like in Tapan kaikki... I think it would be just cool.
It could be map based some maps could have it and other not.

You need to login to create posts in this thread.

fuzinavl
 Official Sponsor

Joined: 06 October 2004
Posts: 287
25 October 2004 03:46 (UK time)

Here are some some screenshots of the secret "shrouder wall" mode. Too bad the activation sequence is lost.
http://fuzinavl.tripod.com/wallshroud2.JPG
http://fuzinavl.tripod.com/wallshroud1.JPG
http://fuzinavl.tripod.com/wallshroud0.JPG
I don't think we'll ever see this in meteor2.

Edited: 25 October 2004 03:48


You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1308
25 October 2004 23:36 (UK time)

Woooooh, looks spooky to me. Ok so you have a 2D grid containing some solid sectors, if anyone would care to do the maths...

You need to login to create posts in this thread.

fuzinavl
 Official Sponsor

Joined: 06 October 2004
Posts: 287
26 October 2004 06:15 (UK time)

This depends on whether you want shrouder walls in the M2 game engine. People with medium machines might need a toggle option.

Actually, it works for arbitrary line segments.
Judging from the Allegro triple buffering demo, black polyfills might be fast enough. (i had 160 huge triangles at once in high res.)

M2 sectors are clockwise line lists? If player is on left side of line, shroud(); else don't_shroud();
this technique only shrouds past the farside exterior of an object, not the object itself.

Data structure issue: object attribute vs. seperate layer
It would be cool if trees had thin shrouds.
Doors should toggle shrouders.
Destroyed huge tanks should stop shrouding.
In flight, all shrouders should be off.
so... shrouder walls need to move with an object and be togglable
how could it be easily integrated into the map / object builder?

My abilities: I have projected huge black quadrilaterals with a working algorithm. I was lazy and let the game programming library clip to the screen for me.

Please give your verdict. I'm ready to make a demo shrouder.exe

You need to login to create posts in this thread.

Raaka-arska

Joined: 22 September 2003
Posts: 109
26 October 2004 16:45 (UK time)

That kind of shrouding would be cool for some zombie modification :)

You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1308
26 October 2004 19:11 (UK time)

M2 polygons can be complex polgons meaning they allow for:

- Clockwise or anti-clockwise verts
- Convex and non convex polygons
- Polygon line intersections

As you may have figured M2 simply draws the polygons by throwing vert arrays at the Allegro "polygon" function (with some limited clipping but this is done while drawing so the polygon data is maintained).

If you can do all of these using either method I could probably integrate your code:

*** METHOD 1 (slow?) ***

1) Fill a screen with complex polygons based on vert arrays
2) Move a point (x,y,angle) around the screen
3) Dynamically produce a shroud layer from this point around the polygons (using the vert array data) in real-time with a varaible FOV and view distance (ok the view distance is not that important but its a handy clipping method).

*** METHOD 2 (better!) ***

Its your lucky day cos the M2 sector CD is real simple. M2 builds a scale map of the terrain (a passable map). In basic terms its a scaled down bitmap of the entire level's terrain using 3 colours (blue = water, green = land, red = solid). Hold down the M key in M2 to see it for yourself. As the passable map is drawn one sector on top of another (its pre-drawn of course but updated whenever the terrain changes) it eliminates the "land bridge over water sector problem".

So here is method 2....

Using a 2 colour bitmap (or buffer) mask draw a shroud from any x,y,angle in real-time. So basically:

1) Draw your 2 colour backdrop
2) Draw your "dot/arrow" at x,y,angle
3) Use the keyboard to move and steer the dot
4) Draw a shroud layer leaving the dot's FOV clear based on the backdrop's mask data.


*************************************

I don't think that the shroud would need to apply to objects. What I mean is that it would cover objects but not work around them.

If you are feeling keen objects are simply an array of rect boxes (x,y,w,h), you don't need to worry about box angles as its binding box CD.

You need to login to create posts in this thread.

fuzinavl
 Official Sponsor

Joined: 06 October 2004
Posts: 287
27 October 2004 04:19 (UK time)

What is a CD ?
what is the advantage of method#2 ? I thought masked rendering took more time than solid polyfills.
I had method#1 in mind.

If i understand correctly, there is a 2-bit mask-bitmap with the same dimensions as the entire level?
This maskmap is used to floodfill_mask the final rendering for land_pass, water_pass, and solid_pass?
So, If I paint Shrouders directly to the map with colour #4 (black), both mapview and final rendering will be solved in one step???
It would take too much time to shrouder wall the entire map (hundreds of line segments) every frame.
Perhaps Shrouder wall normal view only.
And Shrouder wall mapview only when "M" is pressed.

[qoute] I don't think that the shroud would need to apply to objects.[/quote]
Ok, shrouders can exclusively be static map objects.

Draw order:
1) draw ground, water, walls, tanks, infantry, player
2) black out big areas on the backbuffer using big black polygons
3) draw airborne vehicles
4) draw hud

Solution#1 solid sector vert arrays Shall all be clockwise and not self-intersecting. A boolean shrouder variable will be necessary for each solid sector. This would interfere with your current code.

Solution#2 In the map editor you'll need a shrouder mode. Shrouders are line segments which activate when you're on the right side of them. A single line segment could represent one-way glass. Heck ,you could even make colored glass with (fblend) a color attribute and a transparency attribute.
When destroying solid sectors / opening / closing doors... would it be better to toggle shrouder activation booleans or create & destroy shrouder groups?

I prefer solution #2. It is more flexible and can be hand optimized. If there is a high wall around a pond, a clever mapmaker can still show the pond.

Edited: 27 October 2004 04:29


You need to login to create posts in this thread.

James Bunting
Joined: 17 September 2003
Posts: 1308
27 October 2004 17:34 (UK time)

OK let me clear this all up.

CD = Collision Detection.

Rendering is not an issue, I was refering to possible methods to get level terrain CD data.

You are right about the 2-bit passable map, it is actually scaled down (its about 1/5 of the level size, just accurate enough), your demo can use a 1:1 version. You can use a standard 8 or 16 bit bitmap using green and red.

There will be no changes to the Map Editor (except for an option to enable shrouding generally). All the code should be totally dynamic based on the CD data in the passable map.

In terms of objects:

- They will always be hidden by the shroud (ok aircraft may not be).
- The shroud wont go around them (sorry, thats what I meant about not applying to objects).

Your draw order is perfect.

So basically if you took this passable bitmap...
ftp://ftp.jbserver.com/pub/jbgames/meteor2/ExamplePassableMap.jpg
(sorry its a dithered Jpeg but its just a sample!)

Could you make a demo that only leaves a line of sight visible (from any location and angle?) where the red pixels are solid.

Don't worry about reading vert arrays and stuff, also don't worry about scaling it down or using a 2 bit bitmap (8 or 16 is great) as I can sort that out later.

I guess you would somehow need to make a black rectangular Pacman polygon and draw it over the top?

James.

You need to login to create posts in this thread.

fuzinavl
 Official Sponsor

Joined: 06 October 2004
Posts: 287
27 October 2004 22:55 (UK time)

By level terrain CD, do you mean enemies hiding behind hills?

There will be no changes to the Map Editor (except for an option to enable shrouding generally). All the code should be totally dynamic based on the CD data in the passable map.


Seperating the shrouders from the solids will give mappers more freedom. I like shrouders on my treetrunks, but others may not. I can choose to shroud a room from outsiders but not insiders. You'll be able to keep normal sectors completely complex instead of having to adjust them to support shrouders.

I think it would be cool if you couldn't see past large live tanks, but i can see that it might take too much work for too little of an overall effect.

************

I can make the demo, but it will only work off of clockwise vertex array data.

I wasn't thinking of a black pacman around the player. The player can see in all directions, but areas behind brick walls (relative to the player) will be blacked out.

I'll just quickly make something brute force and functional.
The main concern is performance.
If that fails, no new feature to worry about :)

You need to login to create posts in this thread.

fuzinavl
 Official Sponsor

Joined: 06 October 2004
Posts: 287
31 October 2004 16:29 (UK time)

I anticipate I'll have something dirty before November 11th.
A version with a clean algorithm and clockwise / counterclockwise solid sector testing... we'll see

You need to login to create posts in this thread.



Forums system (C) 1999-2023 by James Bunting.

Terms of Use