Game concept graphics

Started by WHAM, Sun 03/04/2011 20:04:34

Previous topic - Next topic

zabnat

I don't see a easy way out of this, at least not as easy as you've tried. I mean if you could get the clipping out, it would still look weird for him to just walk through the edge of the crater. I would probably try something with regions. Making enough regions on top of the crater that would control the y coordinate of the character. I can see some problems with that, but that would be my first though. That way you can actually have the character walk over the edge and into the crater.

Ali

Quote from: zabnat on Sat 16/04/2011 22:59:29
I don't see a easy way out of this, at least not as easy as you've tried. I mean if you could get the clipping out, it would still look weird for him to just walk through the edge of the crater. I would probably try something with regions. Making enough regions on top of the crater that would control the y coordinate of the character. I can see some problems with that, but that would be my first though. That way you can actually have the character walk over the edge and into the crater.

What Zabnat said, but affecting the character's Z co-ordinate would be better. Using a series of 1px wide regions so that the closer the player gets to the edge of the crater the higher they are raised, allowing them to step over the edge.

WHAM

I feared I had to do something like that. There will be about a hundred of these craters in the game, though, so I'll have to see if doing anything with regions is worth the effort. If all else fails, I will just leave them as-is and accept a slight graphical shortcoming to save hours and hours of work.
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Khris

You can do it using purely some calculations; in before fadein for each room, put the center coordinates of all craters in an array, then inside rep_ex, calculate the z.
Basically, check the character's distance from all crater centers (roughly doubling the y-distance as a first step to reflect the perspective distortion), and if they're close enough, turn the distance into z using a function whose graph reflects a cross-section of the crater.

WHAM

Quote from: Khris on Mon 18/04/2011 10:27:42
You can do it using purely some calculations; in before fadein for each room, put the center coordinates of all craters in an array, then inside rep_ex, calculate the z.
Basically, check the character's distance from all crater centers (roughly doubling the y-distance as a first step to reflect the perspective distortion), and if they're close enough, turn the distance into z using a function whose graph reflects a cross-section of the crater.

Might be too complicated for me, but then again just might be doable, but my idea of having three different sized craters will add to the workload a bit.
As this is for a MAGS game, I'm still thinking of taking the simple / easy way out to meet the deadline.
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Cogliostro


Shouldn't you be able to tweak the walkable area so that a triangle of space on the left and right edges of the craters are not walkable?

- Cogliostro
"First things first, but not necessarily in that order." - Dr. Who

WHAM

But then, as the game moves primarily from left to right, the player would have to move up or down to get in or out of the craters, which will just delay the player for no obvious reason.
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

quo_sp

Why don't create an animation for when the soldiers leave the crater?, the animation can jump or climb the crater. You can create regions inside the crater and when a character leave the region you can change the view to the animation and after leaving change it again to normal view.

WHAM

That might actually be worth looking into, deadline permitting.
Is there a limitation to the number of regions allowed per room?
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Khris

There's a total of 16 regions, 1-15 are usable; 0 means no region. For limits to drawn stuff, just open the dropdown menu. Those aren't created, they're always there/available.

WHAM

With that limitation the only way to do this would be to create a massive array of coordinates that have data on all the craters (30-50 per room) and then use the same regions on all craters, checking player coordinates and crater coordinates...

As far as I understand, this also gets quite work-heavy, so the deadline might prune it out too. As is often the case with creating code: there is no easy way out! =)
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

quo_sp

But I think that you only need a region, is the same region_id for all the craters, you only have to draw the region in every crater using the same region_id (only one), the areas of the same region is not necesary that be conected.

Khris

Here's my idea in action: http://www.youtube.com/watch?v=qWL3h2WwMYU

And here's the script: http://codepad.org/sov52lJM
Then put
Code: ags
import void AddCrater(int x, int y);
in the header.

WHAM

That's pretty darn awesome, Khris. 8)
I'll see if I can implement (read: copy/paste) this code in the evening and get it to work. 65 lines of MAGIC!
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

WHAM

Looks like it's working like a charm. I had to move the part you had in repeatedly execure into repeatedly_execute_always, as I already use the repeatedly execute to detect keyboard inputs and when said inputs have stopped (on_keypress didn't seem to do the trick for me).

Thank you, again, Khris!  ;)
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Khris

#35
You're welcome :)

There's a small glitch if one crater is too close above another; if the player is inside the lower crater, he'll also appear behind the upper crater's wall. Either move them further apart or use a second walkbehind and add a walkbehind parameter to each crater.

WHAM

#36
The glitch seems to trigger if two craters are above one another and the player moves from the lower crater to the one higher up, and even 200px range between the craters does not seem to make a difference for me.

I'll probably just work around this by removing craters that are too close to one another vertically, to save time.

EDIT: actually even moving a good distance horizontally and then moving up to another crater triggers the glitch for me. Drat!

EDIT 2: A "solution", I just removed the walk behinds from the craters. They might not seem as deep now, but the effect you built still gives them a good feel. Quick and dirty, just the way I like my solutions! =)
Wrongthinker and anticitizen one. Utterly untrustworthy. Pending removal to memory hole.

Shane 'ProgZmax' Stevens

#37
An alternative to what you're doing that may not only look better but will certainly save you some woe is to make the inner sphere of the crater a hotspot/region and then have it change the player graphic when over it so he's lowered in height and his waist is darkened a bit.  This same approach is used in loads of games when a character walks into water, for instance, and this will allow you to avoid the ugly edges of the crater while making him appear to be stepping down into a hole.  Just make sure you add a ring around the outside to switch him back to his default character animation and you're solid.

SMF spam blocked by CleanTalk