[Script] Litcube's Bounce V1.7: Player Owned Autopilot Fix

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

Post Reply
Firewrath
Posts: 121
Joined: Fri, 3. Aug 07, 05:49
x3tc

Post by Firewrath » Sat, 22. Jan 11, 22:42

heading to bed right now, so real quick:
i used the phoenix mk1 (probably should have said that in my first post, -_-; ), which im guessing is from SRM, no weapons, 20 kestrels and bounce was on, lost two of them within the first few attack runs,
all my test are normally 1-3 big ships, no weapons, VS 20 or so ships with bounce on,
...
*Sigh*
i hate when i start testing stuff, sec, *starts up the game* :P
Me: "....ok, now why wont it start? >.<"
~5 minutes later~
"Ohhhh, riiight, turn it on in the AL settings,........" :oops: :oops:

Anyways,
50 kestrels VS 1 normal phoenix, no loses, ...except 4 to asteroids, :P
i did play with it a little and with 50 VS a deca, one did slam itself into the deca,
but i should be going to bed so i didnt spend more then 5min running it, which isnt enough time for a proper test imo, so i'll try it again later,

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sat, 22. Jan 11, 22:46

@Firewrath: Thanks for getting back to me with that.

Yeah, currently, Bounce uses the engine's "size" attribute plus a third of the "size" again, as a virtual collision sphere. It's not all that great (for our anal standards, as it's still way better than vanilla). It works for most ships, but some stick outside the virtual sphere too far. The Odin is a good example.

Pretty easy to tweak!

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7411
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain » Sun, 23. Jan 11, 00:35

No reason to be a dick. I am just curious when you think it will be ready for use. I have no intentions of testing it, not because I don't want to be helpful but just I don't have the time.

Edit-- Perhaps I am misunderstanding something here though. I am confused as to whether this works on all ships all the time, or it only works when you run a certain script and is just a test. If I put the Bounce plugin on in the AL menu, does it work for all my ships?

I tried turning on Bounce in the AL menu and 2 of my ships changed their name to bounce at the end, however the bounce stayed on their name, even after I docked them, it never changed back.

Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang » Sun, 23. Jan 11, 00:42

Believe this is the first testing phase, next phase will begin once Lit is satisfied with the results. This might be in the testing phase for a while or for a short time depending on how many people test it and what they report results on and also find glitches and bugs :wink: can't forget reports on it's affect on the game performance wise

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7411
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain » Sun, 23. Jan 11, 00:46

I understand it is in the test phase and I wasn't asking when will it be done or anything like that. I just wanted to know if it worked for all ships all the time or only when you run a script and run a test. If it works on all my ships always and is in test phase, that is fine. I will use it in my game and report back if it is working but if it is just for just limited use and only works when running a test scenario in game, then I will wait till it is working for all ships.

Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang » Sun, 23. Jan 11, 00:57

Only works when you run the script

HotSake
Posts: 472
Joined: Sun, 3. Jan 10, 22:15
x3tc

Post by HotSake » Sun, 23. Jan 11, 01:15

BlackRain wrote:I understand it is in the test phase and I wasn't asking when will it be done or anything like that. I just wanted to know if it worked for all ships all the time or only when you run a script and run a test. If it works on all my ships always and is in test phase, that is fine. I will use it in my game and report back if it is working but if it is just for just limited use and only works when running a test scenario in game, then I will wait till it is working for all ships.
So you really want this script, but you don't want to take a few minutes to do the tests needed for it be released? I mean it's in your own self interest to give him some test results so he can release it faster.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sun, 23. Jan 11, 01:21

BlackRain wrote:No reason to be a dick. I am just curious when you think it will be ready for use. I have no intentions of testing it, not because I don't want to be helpful but just I don't have the time.
I wasn't trying to be petulant.

As to the answer to your question, I just didn't have the time.

BlackRain
Moderator (Script&Mod)
Moderator (Script&Mod)
Posts: 7411
Joined: Mon, 15. Dec 03, 18:53
x4

Post by BlackRain » Sun, 23. Jan 11, 06:25

Wow, very witty and humorous, your sarcasm is so subtle. I asked a simple question politely and I get bombarded with childish sarcasm. I was only mildly interested in your work.

User avatar
TrixX
Posts: 2035
Joined: Wed, 18. Aug 10, 14:28
x3tc

Post by TrixX » Sun, 23. Jan 11, 06:31

No need for insults BlackRain. It's still in development.

No idea why the -bounce addon stayed after docking, maybe it leaves when undocked and far enough away.
"If you’re not prepared to be wrong, you’ll never come up with anything original."
Sir Ken Robinson

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sun, 23. Jan 11, 06:38

BlackRain wrote:Wow, very witty and humorous, your sarcasm is so subtle. I asked a simple question politely and I get bombarded with childish sarcasm. I was only mildly interested in your work.
BlackRain, I'm sorry if I offended you. Sometimes my humour isn't well received by others. You and I communicate differently, I have to accept that. I concede.

I understand that if there's only a passing interest in something, then taking the time to test the script probably wouldn't be worth it for the average individual, which is probably why you asked; and that's totally fair. I should have answered your question when you first asked it. My honest intention was to prod you in a numerous way, like a buddy getting a punch in the arm, and laughing about it. I honestly couldn't resist posting my response. I knew it was wrong, but I did it anyway. It's like my fingers walked across the scape of the keyboard on their own accord, dancing their evil as though tiny golems of flesh.

I have a lot to learn about diplomatically communicating with people in the written word.

I'm sorry if insulted you. Please accept my apologies.

Firewrath
Posts: 121
Joined: Fri, 3. Aug 07, 05:49
x3tc

Post by Firewrath » Sun, 23. Jan 11, 06:58

again, quick post, 5hrs sleep, uugh, -_-
Litcube wrote:@Firewrath: Thanks for getting back to me with that.
Yeah, no problem, this script, once out and working to your satisfaction, will save a lot of headaches im sure,
so im happy to test it out, ^-^
Litcube wrote: Yeah, currently, Bounce uses the engine's "size" attribute plus a third of the "size" again, as a virtual collision sphere. It's not all that great (for our anal standards, as it's still way better than vanilla). It works for most ships, but some stick outside the virtual sphere too far. The Odin is a good example.

Pretty easy to tweak!
Yeah, i totally forgot to say this before i went to bed, though i made a note to do so now,
i noticed some of the ships kind of stopping away from the target and shooting as they Slowly inch towards the target ship, then while completely safe from any collision because of their speed and distance, dart off to avoid a 'collision',
so like vanilla, theres going to be a fine line between 'useful attack range' and 'collision avoidance',
(though you might put in a skip with a speed check? that way it would then trigger within some shorter distance, ...using your Bounce though so they dont 'avoid' into the ship, might be too hard to do correctly to be worth 'fixing' though, ^-^; )

i shall test this out later by taking one of the Kestrels and seeing if telling it to attack will let Bounce work on the player ship, this way i can get the range at which it does this,
Also, i shall try and see if the ships without fight computers are attacking at all, i Think they are, but i'll try to make sure,

Also, can you make the enemy ship move around?
i mean right now it just sits there, even while being shot,
it trying to avoid the attack by moving would further help to test how well the attacking ships avoid it,

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sun, 23. Jan 11, 07:12

Firewrath wrote:i noticed some of the ships kind of stopping away from the target and shooting as they Slowly inch towards the target ship, then while completely safe from any collision because of their speed and distance, dart off to avoid a 'collision',

Yes. They totally do that. But your speed check idea is brilliant. If the speed is less than, say 10% (5%?) of the ships capacity, then screw the bounc.
Firewrath wrote:so like vanilla, theres going to be a fine line between 'useful attack range' and 'collision avoidance',
Totally concious of the attack range. There's another issue too. The vitrual bounce collision sphere isn't oblong. It's a sphere. So an Orca, for example, has a huge gap on dorsal and ventricular approaches. I'm working on a lookup table to fix that. You won't have to enter data for every ship, if you leave one out, for example, it'll use the old method. But the new data will look something like this:

X: 1095
Z: 450

So now instead of ships bouncing off of the Odin at 1095 from the top and bottom, they bounce at 450, but still bounce at 1095 if coming in from the side. If you forget to input this in the config file, or just don't give a shit, or you're using a mod that adds a new ship and can't be bothered to add it, it'll use the old method.
Firewrath wrote: i shall test this out later by taking one of the Kestrels and seeing if telling it to attack will let Bounce work on the player ship, this way i can get the range at which it does this.
I already know the exact range, in meters. :) Plus it won't work on the player ship. That'd be so akward! Hah! I'm picturing it now.

Anyway, bottom line: Your speed idea, brilliant. I'm going to see how it looks.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sat, 29. Jan 11, 03:38

Update!


1.0: Release Version


Full playable, working version released for the public. Please re-read the first post before downloading / installing. The first post has been mostly re-written.

Requiemfang
Posts: 3206
Joined: Thu, 16. Jul 09, 12:24
x4

Post by Requiemfang » Sat, 29. Jan 11, 04:16

good to see the release... only thing I don't like... is that you changed it from a AL to manual activation

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sat, 29. Jan 11, 04:20

Requiemfang wrote:good to see the release... only thing I don't like... is that you changed it from a AL to manual activation
It was a step I figured was necessary. My buddies applauded the decision.

The wasted cycles of checking for ships in space just got to me. I could release an AL version again if folks wanted it back.

HotSake
Posts: 472
Joined: Sun, 3. Jan 10, 22:15
x3tc

Post by HotSake » Sat, 29. Jan 11, 05:47

I'm so stoked that you included a method for generating Wall files, because now I can tear it apart and see how it's done! I've been taking notes on how to import certain data from T files into a script-accessible form, which would solve some issues for a lot of mods. Among others, I was designing a method of generating a rough bounding box for any object to use with attack and navigation scripts, which I suspect is similar to your method since it has to happen in-sector (collision detection, right?).

edit: I'm not specifically requesting this, just brainstorming, but could you make a small AL plugin that would automatically activate Bounce if there are enemies and player-owned but not player-controlled ships in the active sector? It would have to poll all the player-owned ships in the sector to get their race IFF settings, get the player's global IFF settings, and check for ships of races considered enemy in either of those sets (since your ships can have IFF settings that differ from the player's). Add a check on a slow loop (like every few seconds) for player-owned ships in the active sector being attacked or targeted by missiles to cover unexpected aggression, and you should have a CPU-light monitor that catches every case. Wouldn't be active if there are no enemies in sector or only the player ship is present. Should catch every other scenario where it would be needed, correct?

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sat, 29. Jan 11, 08:39

Update!
1.1
- Test script destroy everything in sector, commented out
- Fixed an oops bug in check script.


@HotSake: The text file write is about 5 lines of code. Feel free to use it + the Wall Writer text file for whatever you need.

Your edit describes the alpha version AL plugin. So, yes, it's possible. :)

HotSake
Posts: 472
Joined: Sun, 3. Jan 10, 22:15
x3tc

Post by HotSake » Sat, 29. Jan 11, 14:22

Looked at the script; that's a more elegant method than I had in mind, but I see I was on the right track. Why a Xenon station specifically? Does the shape make it better for this purpose? If you want to be super anal about it, I'd think a flat station like a SPP, oriented correctly, would give you a more wall-like wall.

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube » Sat, 29. Jan 11, 19:09

@HotSake: That's what the Bounce.cat/.dat file are for. I made a model of a wall that's 8 KM x 8 KM x 1 meter large. That station uses that model. If you set the YOffset to 0 in the wall generating script, you can see the whole process take place while generating the wall. You'll see all the huge ships in the game getting rammed into the wall from every angle.

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”