View topic - aGorm Mod Images

 All times are UTC + 1 hour

 Page 4 of 6 [ 106 posts ] Go to page Previous  1, 2, 3, 4, 5, 6  Next
 Print view Previous topic | Next topic
Author Message
 Post subject: Re: aGorm Mod ImagesPosted: 18 Nov 2011, 19:20
 Spring Developer

Joined: 08 Oct 2006, 15:58
 Quote:Or Is is because I'm doing somthing wrong?yesQuote:Do I need to have some kind of fail safe for that eventualityyesQuote: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

 Post subject: Re: aGorm Mod ImagesPosted: 18 Nov 2011, 23:17
 Map Creator

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...

 Post subject: Re: aGorm Mod ImagesPosted: 18 Nov 2011, 23:45
 Kernel Panic Co-Developer

Joined: 16 Nov 2004, 13:08
 maybe something like:local clamp = function(x) return math.max(-1,math.min(1,x)) endBRA = 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))

 Post subject: Re: aGorm Mod ImagesPosted: 21 Nov 2011, 15:16
 Map Creator

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.

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

 Post subject: Re: aGorm Mod ImagesPosted: 21 Nov 2011, 15:46
 AI Coder

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

 Post subject: Re: aGorm Mod ImagesPosted: 21 Nov 2011, 16:01
 Map Creator

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)

 Post subject: Re: aGorm Mod ImagesPosted: 21 Nov 2011, 17:17
 AI Coder

Joined: 14 Sep 2004, 10:32
 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.

 Post subject: Re: aGorm Mod ImagesPosted: 21 Nov 2011, 17:18
 AI Coder

Joined: 14 Sep 2004, 10:32
 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.

 Post subject: Re: aGorm Mod ImagesPosted: 21 Nov 2011, 18:35
 Moderator

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

 Post subject: Re: aGorm Mod ImagesPosted: 21 Nov 2011, 18:48
 Moderator

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.

 Post subject: Re: aGorm Mod ImagesPosted: 21 Nov 2011, 19:52
 Kernel Panic Co-Developer

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.

 Post subject: Re: aGorm Mod ImagesPosted: 22 Nov 2011, 00:06
 Moderator

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?

 Post subject: Re: aGorm Mod ImagesPosted: 22 Nov 2011, 10:06
 Map Creator

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

 Post subject: Re: aGorm Mod ImagesPosted: 22 Nov 2011, 18:14
 Moderator

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.aGormYou have indeed correctly identified the issue, and I'm pretty sure it would not be a trivial thing to change.edit: iirc <--- disclaimer

 Post subject: Re: aGorm Mod ImagesPosted: 23 Nov 2011, 01:51
 Moderator

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

 Post subject: Re: aGorm Mod ImagesPosted: 25 Nov 2011, 14:55
 Map Creator

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

 Post subject: Re: aGorm Mod ImagesPosted: 25 Nov 2011, 15:10
 Moderator

Joined: 22 Feb 2006, 01:02
Location: cheap kitchen

 Post subject: Re: aGorm Mod ImagesPosted: 25 Nov 2011, 15:22
 Map Creator

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.

 Post subject: Re: aGorm Mod ImagesPosted: 01 Dec 2011, 09:53
 Imperial Winter Developer

Joined: 24 Aug 2004, 07:59
 hey agorm, I just spotted this and was curiousWas the little building next to the big wind generator where you got the idea for the IW power generators?

 Post subject: Re: aGorm Mod ImagesPosted: 05 Dec 2011, 15:35
 Map Creator

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.

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 4 of 6 [ 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 forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ Spring    Community News       News Submissions    General Discussion    Help & Bugs    Game Lobby       Spring Clans       Lobby Clients    Tournaments    Linux    Mac OS X    Off Topic Discussion Content Creation    Game Development       Game Development Tutorials & Resources    Map Creation       Map Tutorials & Resources    Art & Modelling       Modelling & Texturing Tutorials & Resources    Project Subforums       Kernel Panic       Zero-K       Balanced Annihilation       Spring: 1944       Star Wars: Imperial Winter       XTA       Supreme Annihilation       Caydr's Projects       Evolution RTS       Argh's Projects       The Cursed       NOTA       Damned       Conflict Terra       Engines Of War       Spring Tanks       Journeywar       BattleTech: Legacy       Dune: Evolution       Progressive Annihilation       TA: Factions    Sound Effects & Music Development    News    Development       Dedicated Developer Discussion       New Developer Discussion       Infrastructure Development       Meeting Minutes    AI    Feature Requests    Lua Scripts       The Werewolf Game Site content    Site content       Banners       Welcome images       Videos       Videos - contributions       Screenshots       Screenshots - contributions