Repost: Feature Idea
Displaying 1-14 of 14 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Lunarbeam

Er, this is probably REALLY bad policy, but I'm reposting my feature idea since nobody answered it...don't worry, it'll never EVER happen again (I hate it when people do things like this myself). It's just that this function would be so useful...speaking of which, does anyone know how to code something like this in Verge right now (through scripting, not reprogramming)? Anyway, on with the message:

"This seems like an incredibly useful thing to have, so here goes:

How about a function called trace() that accepts two pairs of tile coordinates and a layer number. It then traces a ray from the first pair to the second. It returns a value from 0 to 100: 0 being that it started in an obstruction on that layer, 100 being that the trace was completed succesfully. Using this method, you can determine the exact location of the collision, too. Yes, I know that it would probably be possible to write this in Verge myself, but the code would probably end up being slow, running in an interpreter and all.

Some tips on writing it:
1) You don't need to check the whole map for elements to collide with. All you need to check is a box drawn by the first and last coordinate.

2) Since tiles are so big (16x16) you only need to check for collisions periodically.

Anyway, thanks for listening. This function would be greatly appreciated..."




-- Lunarbeam @

Posted on 2001-01-04 01:54:02

Devon

So you're saying you want a function that checks for collisions between two specific objects within a given square region? Or a path finding functions that searches for a route from one tile to another within a given area?

It may be that no one understands exactly what you're asking for.

-Devon



--- Square's making money. We're making art.

Posted on 2001-01-04 05:03:37

Lunarbeam

No, I want something that checks a given path for tiles on a given layer. If the path is interrupted by a tile, it returns the percentage of the path that was completed before running into the tile.



-- Lunarbeam @

Posted on 2001-01-04 13:43:22

Lunarbeam

Or running into an obstruction on the obstruction layer. What I want this for is making a lighting system in which walls can obscure light. Right now, if you get close to a light, even through a wall, the screen brightens. See my problem?



-- Lunarbeam @

Posted on 2001-01-04 13:46:17

jesusfreak

NOTHING!



...D...0.......T...H...E......D...E...W... ( hey look @ my new site!! click on te house link!)

Posted on 2001-01-04 20:19:29

Lunarbeam

jesusfreak, why?



-- Lunarbeam @

Posted on 2001-01-04 20:32:04

Leon

If it's a lighting system you're working on, personally I think you could find an easier way to do it. A system like this would really bog the CPU down. Think about it, potentially 360 traces per frame, per light source on screen. That's alot of work for VERGE.
A better idea for a lighting system is to use one of your map layers set to subtractive transparency (mode 4, I think) and create special shadow tiles, which you would place everywhere there is not light, so that the remaining, uncovered areas would appear to be lit. If you put the entities under it in the Renderstring, they would be effected as well. It's way, way easier, and would probably look better. It also puts all the work on the Map Render, which is currently the fastest part of VERGE.

Changing the lighting in game would be a matter of changing tiles through VC. Tricky, but not impossible. With some carefully written code, you could have the light changing function easily avoid going through walls.

If you wanted real-time, pixel-accurate dynamic lighting, then this won't help you, but otherwise, I'd do this instead.

-Devon



"You better believe they're good reasons! All digitally remastered reasons are good reasons! And all of my reasons are digitally remastered reasons! I am, After all, the Hand of God." - Locke, TWGtHaiALF:CYGWIDL?

Posted on 2001-01-04 21:08:30

Lunarbeam

No, my lighting system doesnt work like that...it only blends the character's screen lighter or darker depending on proximity. So, at maximum, I'd need only the number of light sources traced per frame; which will never be too many with the way I use it (usu. 6 or so per level). All I want the function to do is tell me if there's a tile in the way...



-- Lunarbeam @

Posted on 2001-01-04 23:43:20

Devon

You mean what you're doing is changing the brightness of the screen depending on how close the character is to a light source? But you want obstructions to block the light? Doesn't really make any sense to me, but I think you could do it without using a traced line and percentile values. In fact, since obstructions are tile based, you can't do it in anything less than 16x16 blocks anyway. (For each tile, the line can either go all the way through it, or it can't enter at all, there's nothing in between)

A better idea is probably to just develop a function that figures out how many tiles away from the light source you are, then you just add some relative values, like 4 tiles = 25%, 3 = 50%, 2 =75%, etc. Or if your game is high res, just add more values and drop the light values off more gradually.

-Devon

P.S.
I accidentally posted that last one on my brother's account. Sorry.



--- Square's making money. We're making art.

Posted on 2001-01-05 05:46:16

Kazier

I did an effect like this 3.5 years ago or something in Verge1. It was pretty easy.
You only need six zones for the entire map. One was 100% intesity (You were right under the light), another was 80% intensity, then 60%, 40%, 20% and then a 0% zone. Since Verge did fruity things if you didn't set it back to normal yourself (In my experience anyway).
Somebody released a verge Line of Sight demo some time back. You might want to find it; it had the function you're looking for. I recommend you write a function, though, to dump the light's values to a file to save speed and prevent constant calculations while your playing.




Just a note: Breath of Fire II was better than Final Fantasy IV, V, VI, and VIII. This is an exclamation of personal taste, and not an attempt to start a flame war.

Posted on 2001-01-05 14:59:03

Lunarbeam

That's exactly what I was trying to prevent: chunky fadeoff effects. The way my lighting system works now, as you approach a light the screen gradually becomes brighter. What I want to check is whether there are any obstructions between the player and the light source. If there are, then naturally I dont want to blend the screen lighter. I DO NOT want to draw shadows on the map itself; I just want to make the character's screen lighter or darker depending on proximity from a light source. The effect is rather nice in my implementation (check it out at http://lunarfiles.50megs.com and go to the Inn in the upper left of the destroyed town) but this one little detail is bugging me.



-- Lunarbeam @

Posted on 2001-01-05 15:15:15

Lunarbeam

[nt]



-- Lunarbeam @

Posted on 2001-01-06 11:29:26

el_desconocido

use:
if(!gettile(x,y,6))
{
// stuff to do if no obstruction.
}
where x, an y are the coords of where you want to search.
to the right of the player would be
if(!gettile(entity.tx[player]+1,entity.ty[player],6))
for example.



-Pontifex
"How many rocks are there, in the whole world?"

Posted on 2001-01-07 00:50:53

Lunarbeam

*sigh* I want to be able to trace from one screen coordinate to another screen coordinate because sometimes my character isnt entirely past a wall. Also, how do I accurately trace a line made up of 16x16 tiles? It's not exactly going to be accurate...



-- Lunarbeam @

Posted on 2001-01-07 13:44:45


Displaying 1-14 of 14 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.