View topic - aGorm Mod Images



All times are UTC + 1 hour


Post new topic Reply to topic  [ 106 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Re: aGorm Mod Images
PostPosted: 18 Nov 2011, 19:20 
Spring Developer

Joined: 08 Oct 2006, 15:58
Quote:
Or Is is because I'm doing somthing wrong?


yes

Quote:
Do I need to have some kind of fail safe for that eventuality


yes

Quote:
and how would you suggest doing it?


Code:
...
bodyTilt = math.asin(bodyLRHeight/25)
...
BRA = math.asin((BR_height-bodyLRHeight)/47)
FRA = math.asin((FR_height-bodyLRHeight)/47)
BLA = math.asin((BL_height+bodyLRHeight)/47)
FLA = math.asin((FL_height+bodyLRHeight)/47)
...


Remember what the definition of sine is in a right triangle, or better in the unit circle.

Now because sine is a ratio between two numbers, its inverse is only valid where that ratio exists (has a defined value). This happens to be between -1 and 1. If you pass in a value outside that range, you get back a special value which represents a non-number, aka NaN. So, clamp any argument v to math.asin such that -1 <= v <= 1.

edit: goddamn ninjas


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 18 Nov 2011, 23:17 
Map Creator
User avatar

Joined: 12 Jan 2005, 10:25
Location: Still signing off after all these years
OK, so that makes a lot of sense (obviosly if the cliff height is large than the track length one divided by the other will be more than 1, should have noticed that)

So question is... is there a usefull way to set the number to 1 or -1 that doesn't require 2 if statments for each wheel (as I assume thats probably not the best way to do it.)

at the moment all I can think to do is assign "BR_height-bodyLRHeight" to a varible, then do an if >1 then be 1 or if < -1 be -1, but it feels like there must be a better way...


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 18 Nov 2011, 23:45 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
maybe something like:

local clamp = function(x) return math.max(-1,math.min(1,x)) end
BRA = math.asin(clamp((BR_height-bodyLRHeight)/47))
FRA = math.asin(clamp((FR_height-bodyLRHeight)/47))
BLA = math.asin(clamp((BL_height+bodyLRHeight)/47))
FLA = math.asin(clamp((FL_height+bodyLRHeight)/47))


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 21 Nov 2011, 15:16 
Map Creator
User avatar

Joined: 12 Jan 2005, 10:25
Location: Still signing off after all these years
OK, thanks with the help, I've got it checking now and I get no more errors.

Now however I'm stuck with a slightly different but related problem.

Image

The move def means it can go down the side of these cliffs, which is exactly what I want. However... because the unit is 5 x 5 it can easily overhang cliffs/ embed itself into cliffs, as it seems to let the centre of the unit go to the edge of the cliff. Is there anything I can do to make it not do this? Or is it a limitation I'll have to live with (unless I find time to learn c as well... which Is unlikely)

aGorm


Attachments:
issue.jpg [60.04 KiB]
Downloaded 2 times
Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 21 Nov 2011, 15:46 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
You could make limit how far each track is able to deviate from the other tracks and the center?


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 21 Nov 2011, 16:01 
Map Creator
User avatar

Joined: 12 Jan 2005, 10:25
Location: Still signing off after all these years
No, thats not the problem... it needs to be able to do that to get up slopes in its slope tollerance... I dont mind the fact the legs do that when they overhang, what I don't want is it to unit overhang. (Cars dont drive with half the bodywork hanging over the side of a cliff, or have the ability to become incorpral to move the back half through a wall)


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 21 Nov 2011, 17:17 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
I mean in that case 3 of the legs match, and the final deviates quite badly, so you can put minimum and maximums relative to the other legs depending on wether the slope underneath would cause clipping or not. This would prevent instances where 3 legs are flat and one leg is inside a pot hole.


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 21 Nov 2011, 17:18 
AI Coder
User avatar

Joined: 14 Sep 2004, 10:32
Location: Cookieland
Alternatively, think of it as a piece of paper and your 4 legs are the corners, if you hold 3 on a plane, how far is the 4th corner allowed to bend? At the moment it's infinity.


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 21 Nov 2011, 18:35 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
No solution I am aware of at present aGorm.


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 21 Nov 2011, 18:48 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
Everything that leaves the unit's footprint can potentially clip into terrain or other units. That's how it works...
No idea if there are plans to allow for non-square footprints for mobiles.


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 21 Nov 2011, 19:52 
Kernel Panic Co-Developer
User avatar

Joined: 16 Nov 2004, 13:08
Give its suspensions a wide course, and pump them high when the body is at risk of grating an edge.


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 22 Nov 2011, 00:06 
Moderator
User avatar

Joined: 23 Nov 2005, 06:16
Location: Dunedin, New Zealand
Hard to say without having seen how you've coded it. Is the problem that it's tilted that far over or that it picked such a path where it's hanging off the cliff?


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 22 Nov 2011, 10:06 
Map Creator
User avatar

Joined: 12 Jan 2005, 10:25
Location: Still signing off after all these years
Quote:
Hard to say without having seen how you've coded it. Is the problem that it's tilted that far over or that it picked such a path where it's hanging off the cliff?


The latter, IE the path it picked hangs of the cliff. The script is doing exactly what I want it to do. It's the engin and were it thinks the unit can travers thats borked. Imagin it was just a normal tank (say a Challenger 2) and say I was nuts enough to make it 10 by 10 in spring terms.... currently a 10 x 5 bit of footprint would be over the edge of the cliff.

It would make more sense if the pathing only let the footprint move to the edge, not the center.

However I assume that would mean an engine change.

aGorm


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 22 Nov 2011, 18:14 
Moderator
User avatar

Joined: 29 Apr 2005, 00:14
Location: #moddev - join it!
aGorm wrote:
Quote:
Hard to say without having seen how you've coded it. Is the problem that it's tilted that far over or that it picked such a path where it's hanging off the cliff?


The latter, IE the path it picked hangs of the cliff. The script is doing exactly what I want it to do. It's the engin and were it thinks the unit can travers thats borked. Imagin it was just a normal tank (say a Challenger 2) and say I was nuts enough to make it 10 by 10 in spring terms.... currently a 10 x 5 bit of footprint would be over the edge of the cliff.

It would make more sense if the pathing only let the footprint move to the edge, not the center.

However I assume that would mean an engine change.

aGorm


You have indeed correctly identified the issue, and I'm pretty sure it would not be a trivial thing to change.

edit: iirc <--- disclaimer


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 23 Nov 2011, 01:51 
Moderator
User avatar

Joined: 23 Nov 2005, 06:16
Location: Dunedin, New Zealand
Probably a massive effort to change. That being said, could, when a tile has a path cost>k1, the pathfinder increase the cost to nearby tiles with path cost<k2? Where k1 is steep and k2 is flat.


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 25 Nov 2011, 14:55 
Map Creator
User avatar

Joined: 12 Jan 2005, 10:25
Location: Still signing off after all these years
OK, so for now I'm gonna ignor the visual stupidity of the unit doing that as its not like I can do much about it for now.

So moving on... I have worked out how to make it deploy and do the animation for that, but what I dont know is how to tell it it can't move while deployed, and how to stop it shooting when its not deployed. (Also, if you know how to make it deploy automaticly if its not but has been told to shoot... that would be usefull as well.)

I'm assuming it's somthing to do with setting the maxspeed to 0, but I can't find the bit of the wiki that tells you how...

aGorm


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 25 Nov 2011, 15:10 
Moderator
User avatar

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen
http://answers.springlobby.info/questions/709/how-do-i-temp-change-the-weapon-damage-and-speed-of-a-unitid
Why not make new threads for new questions? ;)


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 25 Nov 2011, 15:22 
Map Creator
User avatar

Joined: 12 Jan 2005, 10:25
Location: Still signing off after all these years
becasue then I'll be spamming up teh forum with each new one, instead of just 1 thread ... :-)

aGorm

::EDIT:: Also that site is awesome, I shall look there first from now on and post questions there.


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 01 Dec 2011, 09:53 
Imperial Winter Developer

Joined: 24 Aug 2004, 07:59
hey agorm, I just spotted this and was curious

Image

Was the little building next to the big wind generator where you got the idea for the IW power generators?


Top
 Offline Profile  
 
 Post subject: Re: aGorm Mod Images
PostPosted: 05 Dec 2011, 15:35 
Map Creator
User avatar

Joined: 12 Jan 2005, 10:25
Location: Still signing off after all these years
Relly not sure, its possible I had seen that at some point and it inspired me later down the line... didn't have a visual referance when I originaly made them though other than my own doodles.


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 106 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.