Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment   Page 1 of 2      1   2   Next
mattssheep4

Avatar / Picture

Registered:
Posts: 128
Reply with quote  #1 

We know a bit about the scripting for artemis 3. It'll be in python, and we have some example code Mike has provided recently here. 

From what has been provided so far, mission scripts need at least two functions be be defined (well, it's possible neither of them NEED to be defined, but anyway):

HandleScriptStart()
and 
HandleScriptTick()


Seems pretty obvious what they do. Pretty standard stuff. I expect there may be others added at some point, perhaps a
HandleScriptEnd()
 function, for example, for purposes of persistence and such.


Personally, my biggest hope is that there will be events to hook onto. 

For example, let's say there's some damage to the torpedo system. Since that could effect the torpedo's ability to be loaed, I would want the ability to hook into a StartTorpedoLoad event and run a bit of code whenever a torpedo is loaded.

I could give lots of examples, but I think that one shows what I'd like to see. 
Some events are probably things which could be determined during the HandleScriptTick() function, but from a code organization perspective, I'd much rather just have defined events. 
Ideally, we'd be able to add listeners for events dynamically. For example, a ship takes damage, which would trigger the OnTakeDamage event. In my code for the OnTakeDamage event, I check to see if the torpedo system has taken damage. If it has, I then add a listener for StartTorpedoLoad event from my above example, passing the name of the function I want to run when that event happens. And when the damage is repaired, I would remove that listener. That way the StartTorpedoLoad code only runs when I need it to.

What are your thoughts? What do you hope to is available to us in the new scripting system?

 Side note: I'm working on a functional (if basic) demo of what I hope to see in A3's GM console, which I will share when it's ready. I'll probably make a separate thread for GM console discussion.


__________________

Captain Matthew Vaj

Former Commanding Officer, TSN Viper, 2nd Space Fleet, 4th Light Division

TSN RP Community - Listen to our Fleet News Service! - Join our Discord Server!

Intelligence Officer of the Cygnus Campaign

Xavier Wise

Registered:
Posts: 1,362
Reply with quote  #2 

I have taken a closer look at the code posted by Mike S to see what I could figure out from it. I apologise for not using correct coding terminology throughout, but here is what I have found and understood from the code posted.

def HandleScriptStart():


This looks like a function that you create as the "start block" for the script. In other words, the game calls this function when the mission script first loads. I am assuming that you need to create this function with the specific name HandleScriptStart. I do wonder if you can pass in local variables to the function from outside this function, e.g. HandleScriptStart(PlayerList)

def HandleScriptTick():

This looks like a function that is called each tick of the script. Basically, this is the other "events" in the script that will be called when the conditions of those events are met e.g. a variable is a set value. I figure that whilst the mission is running, the game will call this function repeatedly until the mission is ended.

These look to be some of the hooks:
-------------------------------------------------------------------------------------------------------

GS_Get_Simulation()

I am not entirely sure what this function does. It looks like it might be what is manipulated to start/end the simulation.

-------------------------------------------------------------------------------------------------------
GS_Make_New_Player("playership", "Battle Cruiser")


This looks like it will make a new "object" that can be manipulated in the game. The object can be stored as a named variable and called later e.g.
ship1 = GS_Make_New_Player("playership", "Battle Cruiser")


The first entry looks to be the object's side/ faction, and the second is the ship type. These look similar the original "keys" currently in use in Artemis 2.x. The "New_Player" looks to specifically refer to the object being a ship that is playable.

In addition to this, there are also two other "Make_New" hooks to make "Passive" objects (nebulae and asteroids) and "Active" objects (bases, and ships). Below are the three examples from Mike S' code:

GS_Make_New_Passive("asteroid", "Asteroid 1")

GS_Make_New_Passive("nebula", "nebula")

GS_Make_New_Active("npcship", "Battleship")

GS_Make_New_Active("npcship", "Dreadnaught")


-------------------------------------------------------------------------------------------------------
GS_Get_Object(ship1)

This looks like a hook that refers specifically to the object that was created. This "ship1" in this example refers to the player ship that was created in the earlier example. So ship1 was created as an object, and now that object can be stored as a specific variable and manipulated e.g. TSN_Sabre = GS_Get_Object(ship1)

The code doesnt look limited to Active or Player objects. In the code provided by Mike S, there is reference to a passive object that as created as well:

asteroid = GS_Get_Object(asteroidID)


It looks like you can then track specifics about the object using
.tickType
 
.pos.x

.pos.y

.pos.z

I am not sure what tickType does, but the others seem self explanatory.

-------------------------------------------------------------------------------------------------------
GS_Move_Object(TSN_Sabre, 100,0,100)

This hook looks like it is called to position the object in space. Here you can see that the TSN Sabre object that was created will be positioned with the coordinates 100, 0, 100. 

Again, this is not limited to Player/Active objects - this is also used in Mike's code to position asteroids.

GS_Move_Object(asteroid, 100*i,0,-100)

(Note, this was used in a "for" loop, hence the variable i being used as a multiplier)

-------------------------------------------------------------------------------------------------------
GS_Delete_Object()

This is the final hook that I could find in the code posted by Mike. This function looks like it is simply used to remove objects from the map.

-------------------------------------------------------------------------------------------------------
Creating a new object in the game then is done by first using the Make_New hook, then setting it as a variable using the Get_Object, and setting its position using the "Move_Object" functions. Here is an example:

Creating a player ship
ship1 = GS_Make_New_Player("playership", "Light Cruiser")
TSN_Sabre = GS_Get_Object(ship1)
GS_Move_Object(TSN_Sabre, 1000,0,1000)


Creating an NPC Ship
enemy1 = GS_Make_New_Active("npcship", "Battleship")
Kralien = GS_Get_Object(enemy1)
GS_Move_Object(Kralien, 3000,0,3000)


The same process is used for creating a single asteroid or nebula object. A 'for' loop can be used to make multiple objects too, cycling through the same block a set number of times e.g.
for i in range(10): 
would cycle through the code 10 times.

Hope that helps shed light on how the new scripting system will work. I have quite enjoyed working out how things might be scripted, and I am looking forward to getting stuck in!


__________________
Fleet Captain Xavier Wise - TSN Sabre
Link to TSN RP Community Website

Want to follow development of the TSN Sandbox? Head here:
https://ko-fi.com/xavierwise
Darrin

Registered:
Posts: 434
Reply with quote  #3 
I am only just learning Python, so please keep in mind that I am probably going to be explaining things very badly and using the wrong terms. I've been working with Thom, Mike, and Doug on some of the scripting for Artemis 3. (This usually consists of a somewhat weekly Zoom meeting where the scriptors whine at Thom about everything we want to put in the game, and Thom pretends to listen to us while he codes.)

Quote:
Originally Posted by Xavier Wise

def HandleScriptStart():


This looks like a function that you create as the "start block" for the script. In other words, the game calls this function when the mission script first loads. I am assuming that you need to create this function with the specific name HandleScriptStart. I do wonder if you can pass in local variables to the function from outside this function, e.g. HandleScriptStart(PlayerList)

def HandleScriptTick():

This looks like a function that is called each tick of the script. Basically, this is the other "events" in the script that will be called when the conditions of those events are met e.g. a variable is a set value. I figure that whilst the mission is running, the game will call this function repeatedly until the mission is ended.



Yep. There are two functions that will be required in an Artemis 3 script: HandleScriptStart() and HandleScriptTick(). Functions in Python have to either be called, or they can initialize themselves (run itself once it's been declared). These two functions don't need to be called/initialized, as the Artemis code will do that automatically as it runs the mission script.

HandleScriptStart is like the Start Block in Artemis 2. It's called exactly once when the script starts, and doesn't run again. So this is where you put all your "build the sector" stuff, and any other "prep" stuff that you need to sort out at the start of the mission.

HandleScriptTick() is run after every tick, so this is where your "main program loop" stuff happens. In Artemis 2, the game would cycle through all of the events defined in the mission script and check the conditions to see if that event should execute. In Artemis 3, the code structure is much more flexible. You can put all the mission code in HandleScriptTick, or you can put all your functions elsewhere and call them in HandleScriptTick as you need them. 

There currently is no HandleScriptEnd(), so there's no way to end the mission in the code right now. Earlier today, Doug was working on converting one of Mike's tournament scripts into Art3 code, and he made a joke about ending the mission by intentionally causing a crash... although I'm not sure if he was joking. We really don't have a way to end a mission yet. 

Quote:
Originally Posted by Xavier Wise


GS_Get_Simulation()

I am not entirely sure what this function does. It looks like it might be what is manipulated to start/end the simulation.



"theSimulation" is the container object that contains all of the game/mission stuff. In object-oriented languages, everything you create in the game has to "belong" to something, either as a parent (a thing that owns something else) or a child (something owned by another thing). "theSimulation" is the object that owns everything, so it's sort of "The Universe". GS_Get_Simulation() is the function that tells Python to go get a simulation object so we can start putting stuff inside it. 

There's been some discussion between Thoma and Doug over syntax and formatting. Thom is used to C++ so a lot of his Python code still has semicolons at the end of every line. (semicolons in Python aren't used as statement terminators, they are statement separators, so adding a ; to a Python statement with nothing after it tells Python to execute a "null" statement... actually, I'm not sure if the parser just ignores it or adds a "do nothing" command.) Thom tends to prefer longer, more descriptive variable names, while Doug suggested he use just "GS_Get_Simulation(sim)" instead, as it's easier for the scriptors to write "sim" instead of "theSimulation". 

There's also been some haggling over whether to use CamelCase or snake_case. I'm not sure if either side has won that battle yet, as the code I've seen so far switches between the two. 
 
Quote:
Originally Posted by Xavier Wise

GS_Make_New_Player("playership", "Battle Cruiser")


This looks like it will make a new "object" that can be manipulated in the game. The object can be stored as a named variable and called later e.g.
ship1 = GS_Make_New_Player("playership", "Battle Cruiser")




"playership" is an object type that has all the properties and methods associated with a player ship. "Battle Cruiser" is a reference to the shipData.json file where all of the different ship types are defined (similar to the "vesselData.xml" file from Art2). 

Quote:
Originally Posted by Xavier Wise


The first entry looks to be the object's side/ faction, and the second is the ship type. These look similar the original "keys" currently in use in Artemis 2.x. The "New_Player" looks to specifically refer to the object being a ship that is playable.

 

I don't believe there's any side/faction in the game yet. The first line defines a player object and assigns it to "playerID" as a reference. The second line "player = GS_Get_Object(playerID)", I believe that actually creates the object in the game. I'm still pretty fuzzy on what exactly is the difference between "player" and "playerID".  

Quote:
Originally Posted by Xavier Wise


In addition to this, there are also two other "Make_New" hooks to make "Passive" objects (nebulae and asteroids) and "Active" objects (bases, and ships).

Below are the three examples from Mike S' code:

GS_Make_New_Passive("asteroid", "Asteroid 1")

GS_Make_New_Passive("nebula", "nebula")

GS_Make_New_Active("npcship", "Battleship")

GS_Make_New_Active("npcship", "Dreadnaught")




Active objects are things the code has to worry about moving around the playfield. A passive object doesn't move, so the code has a lot less to keep track of.

To put a new object in the game, you have to first make/define it, so the code will know what attributes/properties it has. Second, once it's been defined, you can "get" the object, which creates it. The four statements above define four different object types. The first argument is the object type, and the second argument is a reference to the shipData.json file, so it can fill in the correct attributes/values.

So, as I understand it:

ship1 = The variable representing the player ship. Once the variable is assigned to a player object, you can get/change/assign the different properties of that particular player object via "ship1.pos.x", "ship1.maxspeed", "ship1.drive.warp", etc. 

player = object type. A "player" object has properties for xpos, zpos, hull type, number of torpedoes, etc. 

playerID = reference to the player object. The playerID can also be added to a playerList object, so that the game/script can keep track of the different players in the game. In the sample code, there's only one player, so no playerList. However, there is an asteroidList that keeps track of all the asteroidIDs.   

Quote:
Originally Posted by Xavier Wise

I am not sure what tickType does, but the others seem self explanatory.


Thom told me what tickType meant, but unfortunately I don't remember it. I'll try to ask him again on Wednesday. 

Quote:
Originally Posted by Xavier Wise

GS_Move_Object(TSN_Sabre, 100,0,100)

This hook looks like it is called to position the object in space. Here you can see that the TSN Sabre object that was created will be positioned with the coordinates 100, 0, 100. 

Again, this is not limited to Player/Active objects - this is also used in Mike's code to position asteroids.


Yes, GS_Move_Object will reposition something in the game. In Artemis 2, when you created a new object, you usually gave it the coordinates as part of the arguments when you create it. I'm not sure if that's something that will be added later, or if we have to move every object once we create it. 

So... mission scripting for Artemis 3 is going to be a little more involved than Artemis 2. Python is a very powerful language, but it's also a full programming language rather than a series of XML tags. We'll have a great deal more power at our fingertips, but also a very steep learning curve. 

As I understand it, part of Thom's goals for Artemis 3 is he wants to fix a lot of the really klunky "mistakes" he made 20 years ago, and he also wants to expose as much of the game as he can so that scriptors/modders can create the gaming experience they're after. So we've been discussing things like making the brain stacks and the behavior code for the npcships as Python modules rather than in the game code. Things like torpedo values that were hard-coded in Artemis 2 will be... not as hard-coded anymore. So if you need your mission script to do something when the torpedoes get loaded... well, I can't make any promises about that, but in theory at least... it should be easier to do that... we hope.

A couple weeks ago, Thom asked us what might be the maximum number of shields that a ship could have. Movement in Art3 is supposed to involve more 3D than 2D, so it's more likely you could be attacking ships directly above or below them. A borg cube, for example, could have six shields, one for each side of the cube, and a mission script might involve the players having to determine which side is "weakest", or maybe they have a hack that brings down the "top" shield. However, I'm not sure it would be fair to the Engineer to have to keep track of six shield sliders instead of two. So after some discussion, we suggested to Thom that we should keep the default shields at 2 for Front/Back, but Thom built the code so that if he has to add more shields later, it's easier to do that.

 


__________________
Call Sign (EF/TSN): Bassellope

mattssheep4

Avatar / Picture

Registered:
Posts: 128
Reply with quote  #4 

Quote:
Active objects are things the code has to worry about moving around the playfield. A passive object doesn't move, so the code has a lot less to keep track of.


Is movement the only factor here in this case? Could you make an active asteroid or a passive ship? In the TSN RP Sandbox we have a system with randomly moving black holes. It would be a really interesting challenge for a helmsman to have a dynamic asteroid field to fly through. I had a follow-up question but I've now forgotten it.....

Quote:
 So we've been discussing things like making the brain stacks and the behavior code for the npcships as Python modules rather than in the game code. Things like torpedo values that were hard-coded in Artemis 2 will be... not as hard-coded anymore. So if you need your mission script to do something when the torpedoes get loaded... well, I can't make any promises about that, but in theory at least... it should be easier to do that... we hope.


Super excited about every part of this!!!!!!! I definitely would like to have the ability to write custom brain stack code, regardless of whether the default behaviors are hardcoded.

Quote:
So after some discussion, we suggested to Thom that we should keep the default shields at 2 for Front/Back, but Thom built the code so that if he has to add more shields later, it's easier to do that.


I'd like to see this be an editable setting, personally. Would be interesting if the individual engineer could make that choice on the fly. Glad to see the possibility for multiple sided shields is there (especially if scripters can hook into them)!

From Mike's post: 
Quote:
GS_Move_Object(asteroid, 100*i,0,-100);
# asteroid.pos.x = 100 * i;
# asteroid.pos.y = 0;
# asteroid.pos.z = -100;

Since I suspect that "asteroid.pos.x" is a only a getter (if that's even valid syntax for scripting since those bits are in comments, which could mean that is only for explanitory purposes), it seems likely that to move an object in only one direction, you would have to use GS_Move_Object every time; you couldn't use just use "asteroid.pos.x = 100*i" in the script directly. Please correct me if this is not the case.

Will there be a way to set the velocity of an object? In A2 we have the topspeed and direction variables to modify, so I'm curious how velocity will be handled in A3. 


__________________

Captain Matthew Vaj

Former Commanding Officer, TSN Viper, 2nd Space Fleet, 4th Light Division

TSN RP Community - Listen to our Fleet News Service! - Join our Discord Server!

Intelligence Officer of the Cygnus Campaign

mattssheep4

Avatar / Picture

Registered:
Posts: 128
Reply with quote  #5 

Quote:
Movement in Art3 is supposed to involve more 3D than 2D


To what extent is this the case? Is there a practical vertical limit for us to use in scripting? Or is it going to be similar to the "unlimited universe" that is planned for A3?

Also how does that effect the helm station, in terms of maneuvering?


__________________

Captain Matthew Vaj

Former Commanding Officer, TSN Viper, 2nd Space Fleet, 4th Light Division

TSN RP Community - Listen to our Fleet News Service! - Join our Discord Server!

Intelligence Officer of the Cygnus Campaign

Gypsyjuggler

Registered:
Posts: 171
Reply with quote  #6 
I would think everyone that has their joystick programmed as "Push Forward- go faster" will have to change things up.
Darrin

Registered:
Posts: 434
Reply with quote  #7 
Quote:
Originally Posted by mattssheep4

To what extent is this the case? Is there a practical vertical limit for us to use in scripting? Or is it going to be similar to the "unlimited universe" that is planned for A3?



As of right now, the playfield is effectively unlimited. Your starting point will likely be marked by a new object currently called a Landmark. Direction/heading to the landmark will be indicated by a marker on the helm display. You can create new landmarks with different colors, so you can indicate a "region of interest" some distance away, if you like. 

All objects in the game will have x,y,z coordinates, so you can establish an landmark at (0,0,0) and create your "sector" by creating terrain around that point. 

Quote:
Originally Posted by mattssheep4


Also how does that effect the helm station, in terms of maneuvering?



Right now, the helm controls are simplified for testing purposes. There's a throttle slider, a roll slider, and a "steering box" that controls pitch and yaw. The steering "autocenters" the ship back to a pitch/yaw/roll of 0.0, so you can now change elevation, but the ship automatically returns to a "horizontal" orientation similar to how the game started. So as of right now, there's still a well-defined up/down, and presumably mission scripts will assume most of the interesting objects to interact with will be roughly laid out in a horizontal "plane" that players should already be familiar with.

The helm controls will change as Thom gets Art3 closer to release. I'm not sure if he'll stick with autocentering or try something similar to flightsim controls. I suspect there will be a "default" helm control and then have a few different options for different play styles.

One of the features on the "wish list" for Art3 is to be able to build "custom" clients. So the widgets on each client screen can be dragged/resized. Scriptors will be able to add new controls, such as an "Activate Wave Motion Gun!" to the weapons console, or an "Initiate Corbomite Device" slider to Engineering. The widgets could also be mix-n-match, so if you want to add Helm controls to your Science console, or have your Comms Officer load torpedoes, then that should be something you can customize. (I'm not entirely sure how this will work from the console selection screen, if it will use custom .ini files or be driven from inside the script.)






__________________
Call Sign (EF/TSN): Bassellope

mattssheep4

Avatar / Picture

Registered:
Posts: 128
Reply with quote  #8 
Quote:
Originally Posted by Darrin

You can create new landmarks with different colors, so you can indicate a "region of interest" some distance away, if you like. 


Is this something that can only be done in the script, or could captains place a landmark or "waypoint"?
This would be particularly useful for multi-ship games, so the admiral/commodore/fleet captain/ect could designate areas of operation and such.

Also do you have any further information regarding my questions in this post?

Oh, and have you found out what `tickType` is for?

__________________

Captain Matthew Vaj

Former Commanding Officer, TSN Viper, 2nd Space Fleet, 4th Light Division

TSN RP Community - Listen to our Fleet News Service! - Join our Discord Server!

Intelligence Officer of the Cygnus Campaign

Darrin

Registered:
Posts: 434
Reply with quote  #9 
Quote:
Originally Posted by mattssheep4

Is this something that can only be done in the script, or could captains place a landmark or "waypoint"?


Disclaimer: I am not Thom, so anything I say here is not "official". 

In the current incarnation of Artemis, there's the "Captain's Map" client, but the original intention of the Captain position was they didn't have a dedicated station. There are a variety of ways that various crews use the Captain's Map. That being said, if you're asking, can you add a custom button to the Captain's Map that will create a new Navpoint at the coordinates indicated on the captain's map? Yes, that will probably be something you can add via scripting. (This isn't coded yet.)

Quote:
Originally Posted by mattssheep4

Also do you have any further information regarding my questions in this post?


Yes.

Quote:
Originally Posted by mattssheep4

Is movement the only factor here in this case? Could you make an active asteroid or a passive ship? In the TSN RP Sandbox we have a system with randomly moving black holes. It would be a really interesting challenge for a helmsman to have a dynamic asteroid field to fly through.



I'm not quite sure active/passive is an attribute you can change as part of the "type" classification. If you mean, can you make a player ship act like a passive, or a passive object like an asteroid move around like an active ship, then yes, that should be possible. In my Tic-Tac-Torgoth script, I originally wrote it when npc ships didn't move, and when Thom sent me an updated version of his code, it broke my script when the Torgoths started to fly away and then shoot at the player. So I had to rewrite it, Thom had to rewrite how system damage works, and then had to change how the code initializes the system values for npcships. As it's currently written, the Torgoths in my script are now "passive" in they don't move/shoot, but that's because I've set their system damage to weapons, engines, and shields to max. I think in an earlier version of my code, I tried setting the Torgoth to "passive", but then you couldn't destroy them (passive objects don't explode... yet.) So I'm not sure if active/passive will be something you can set or change as part of the object type. 

That being said, one of my design goals (not necessarily Thom's) for Artemis Cosmos is to be able to switch object types quickly/easily, so I can have enemy ships hiding as an "asteroid", a cruiser hiding inside a "cargo tug", etc. Part of what Thom's doing now with the full rebuild is making sure all the underlying structures in the code are much easier to manipulate that way. However, I can't say how much of that flexibility we'll get in the final build. 

Under the Artemis 2 code, yes, you can manipulate black holes because they can be named objects, and thus you can change their values in the script. Asteroids were not named objects, so it's much more difficult to manipulate them. Creating a dynamic asteroid field would be much more difficult in Art2... you could possibly do it by destroying/creating new sets of asteroids every tick, but it would probably be very klunky and "jumpy" from the player perspective. 

Under the new code, asteroids will be named objects, so yes, it would be much easier to code a dynamic asteroid field.

(I have done some very filthy things with moving around black holes.)

Quote:
Originally Posted by mattssheep4

Super excited about every part of this!!!!!!! I definitely would like to have the ability to write custom brain stack code, regardless of whether the default behaviors are hardcoded.


Current thinking is to have the brainstack/AI stuff coded as a separate Python module, so yes, that should be something you can modify, but again, caveats and such: it isn't written yet. 

Quote:
Originally Posted by mattssheep4

I'd like to see this be an editable setting, personally. Would be interesting if the individual engineer could make that choice on the fly. Glad to see the possibility for multiple sided shields is there (especially if scripters can hook into them)!


As of right now, it's currently editable, so you could change shipname.shield_count = int, but I don't think the code does anything with any value other than 2. 

Quote:
Originally Posted by mattssheep4

Will there be a way to set the velocity of an object? In A2 we have the topspeed and direction variables to modify, so I'm curious how velocity will be handled in A3. 



I'm not sure about this, as the "behavior" of how active objects move is mostly placeholder code right now. Yes, you can move things by using the .reposition_space_object method, or setting the x,y,z coordinates, but that's not exactly the same thing as an npcship setting it's own course and speed. I suspect that yes, you will be able to change the velocity of space objects moving around.

If you meant, can we manipulate the velocity of things like torpedoes/drones... yes? I think that will be possible. As in, torpedoes and such will have default values as far as speed, damage, etc., and those should be editable, maybe in an .ini file or maybe something in the shipData file. Since the torpedoes/drones are also going to be space objects, then you should also be able to edit their values "on the fly", so if you want to change the velocity, damage, burst radius, etc. of a torpedo inside a script even after it's been fired, or if it passes close enough to a certain object... that should be possible. But again... this code hasn't been written yet.

Quote:
Originally Posted by mattssheep4

Oh, and have you found out what `tickType` is for?


Yes. tickType is a value on an active space object that tells the code what that particular object should be doing when the tick cycles. As I understand it, when the code processes the "tick", it goes through a list of all the active space objects, and the tickType tells it what functions/modules it needs to process for that object: movement, damage, weapons, shields, etc. If it's an npcship, then it's usually moving towards a target, or firing weapons if a target is close enough. If the npcship gets shot by a player, then the tickType changes so the code knows "hey, I have to calculate some damage here". I'm not sure if it's something we can change (or would want to change) at the scripting level, as it might seriously muck up how the game code processes movement/damage/etc.




__________________
Call Sign (EF/TSN): Bassellope

mattssheep4

Avatar / Picture

Registered:
Posts: 128
Reply with quote  #10 

So many things I want to ask, but I realize there's lots that isn't imlemented yet, and thank you for all the information you're sharing!

Quote:
Originally Posted by Darrin

Disclaimer: I am not Thom, so anything I say here is not "official". 


Noted 😋

Quote:
Originally Posted by Darrin

I'm not quite sure active/passive is an attribute you can change as part of the "type" classification. If you mean, can you make a player ship act like a passive, or a passive object like an asteroid move around like an active ship, then yes, that should be possible. In my Tic-Tac-Torgoth script, I originally wrote it when npc ships didn't move, and when Thom sent me an updated version of his code, it broke my script when the Torgoths started to fly away and then shoot at the player. So I had to rewrite it, Thom had to rewrite how system damage works, and then had to change how the code initializes the system values for npcships. As it's currently written, the Torgoths in my script are now "passive" in they don't move/shoot, but that's because I've set their system damage to weapons, engines, and shields to max. I think in an earlier version of my code, I tried setting the Torgoth to "passive", but then you couldn't destroy them (passive objects don't explode... yet.) So I'm not sure if active/passive will be something you can set or change as part of the object type. 


Would you mind sharing your Tic-Tac-Torgoth code? Xavier and I are impatient to see what functionality is available and want to start working on our own code asap.

What do you mean by "set their system damage to weapons....to max."? Is that system damage as in, they've taken enough damage that they can't use those systems?

I expect that one of the AI options will be a "passive" mode where they will ignore attacks etc. 

Quote:
Originally Posted by Darrin

That being said, one of my design goals (not necessarily Thom's) for Artemis Cosmos is to be able to switch object types quickly/easily, so I can have enemy ships hiding as an "asteroid", a cruiser hiding inside a "cargo tug", etc. Part of what Thom's doing now with the full rebuild is making sure all the underlying structures in the code are much easier to manipulate that way. However, I can't say how much of that flexibility we'll get in the final build. 

Is "Artemis Cosmos" the name Thom has settled on for A3?
At the very least I expect it'll be relatively simple to delete one game object and create a new one in its place. 

Quote:
Originally Posted by Darrin

As of right now, it's currently editable, so you could change shipname.shield_count = int, but I don't think the code does anything with any value other than 2. 

I had previously assumed that would be a global setting, where the number of shield facings would be the same within any given game. But having it be on a per-ship/station/other basis adds some very interesting possibilities. I'll have to be patient on this though since I kinda don't expect the initial release to deal with more than just the two facings.

Quote:
Originally Posted by Darrin

I'm not sure about this, as the "behavior" of how active objects move is mostly placeholder code right now. Yes, you can move things by using the .reposition_space_object method, or setting the x,y,z coordinates, but that's not exactly the same thing as an npcship setting it's own course and speed. I suspect that yes, you will be able to change the velocity of space objects moving around.

Is the "reposition_space_object" method different somehow than the "GS_Move_Object" method? Is it a built-in function that's part of the space object class, while "GS_Move_Object" more like a global function?
I'm curious about velocity changes with regards to black holes and such - it would be interesting to be able to add custom forces to an object under some circumstances. But I'm not sure that artemis, being in space, warrants somewhat complex multiple-force calculations. It would be cool to add custom things like anti-gravity bombs, which you could fire if you got too close to a black hole and would add a pushing force between you and the black hole, helping you escape.

 

As a side thought - how much customization will black holes and other terrain have in terms of size, color, and (in the case of black holes) gravity magnitude? (If you happen to know).

Quote:
Originally Posted by Darrin

If you meant, can we manipulate the velocity of things like torpedoes/drones... yes? I think that will be possible. As in, torpedoes and such will have default values as far as speed, damage, etc., and those should be editable, maybe in an .ini file or maybe something in the shipData file. Since the torpedoes/drones are also going to be space objects, then you should also be able to edit their values "on the fly", so if you want to change the velocity, damage, burst radius, etc. of a torpedo inside a script even after it's been fired, or if it passes close enough to a certain object... that should be possible. But again... this code hasn't been written yet.

I was referring to ships in particular, but it would be awesome to make custom torpedoes that do funky things like some missiles that can change velocity to evade countermeasures or surprise a foe. I've got tons of spin-off ideas but this probably isn't the place for them.

I DO very much want to have the capability to define custom torpedo variants, but I think that's been confirmed already. A couple related questions:

Beams in A2 use a certain amount of energy per shot. Will this energy use be customizeable?

Beam color (as showns in helm, weap, tac screens) currently uses a voodoo calculation using range and playerdamage iirc. Are there plans to make the color a defineable attribute in the ship data file?

Will weapons officers be able to designate which beams to fire at a particular target, instead of always firing all beams able to hit the target?

Will npc ships be able to use torpedoes other than drones? E.g. an npc Artemis class could fire nukes, for example. I'd be happy if this wasn't the default, but could be specified via custom brain stacks.


Quote:
Originally Posted by Darrin

Yes. tickType....

I'm curious to see what values tickType could be, and how we could use the current tickType in scripting. I'll plan on not changing it though 😋

Thanks for your patience with all my questions! I really appreciate your in-depth responses!


__________________

Captain Matthew Vaj

Former Commanding Officer, TSN Viper, 2nd Space Fleet, 4th Light Division

TSN RP Community - Listen to our Fleet News Service! - Join our Discord Server!

Intelligence Officer of the Cygnus Campaign

Darrin

Registered:
Posts: 434
Reply with quote  #11 
Quote:
Originally Posted by mattssheep4

Would you mind sharing your Tic-Tac-Torgoth code? Xavier and I are impatient to see what functionality is available and want to start working on our own code asap.



Posted here. 

Quote:
Originally Posted by mattssheep4

What do you mean by "set their system damage to weapons....to max."? Is that system damage as in, they've taken enough damage that they can't use those systems?



Sorry, I worded that badly. Right now, npcships have four systems that can take damage: Weapons, Engines, Sensors, and Shields. Damage value is a float that goes from 0.0 to 2.0. (I'm not sure why it has that particular range). To set system_damage on an npcship, you specify the float value (0.0 = 0%, 0.5 = 25%, 1.0 = 50%, 1.5 = 75%, 2.0 = 100%, etc), and you give the index value for the system. I think Weapons = 0, Engines = 1, Sensors = 2, Shields = 3. Here's the code from Tic-Tac-Torgoths for setting the npcship data set:


npcship.data_set.set("system_damage",2.0,0)
npcship.data_set.set("system_damage",2.0,1)
npcship.data_set.set("system_damage",2.0,3)
npcship.data_set.set("shield_max_val",0.0,0)
npcship.data_set.set("shield_max_val",0.0,1)
npcship.data_set.set("shield_val",0.0,0)
npcship.data_set.set("shield_val",0.0,1)


So the first line sets system #0 (Weapons I think) to 2.0, which is 100% damage (hence why I said "max").
Second line sets system #1 (Engines) to 2.0, also 100% damage.
Third like sets system #3 (Shields) to 2.0, also 100% damage. 
System #2 is sensors. It shouldn't matter if the Torgoth can see the player ship, so I left it alone. 

I wasn't sure if shields can regenerate yet, so just in case, I set the max value for Shield #0 (front?) to 0.0, and Shield #1 (back?) to 0.0. 
Then I set the current shield value for both shields to 0.0. 

Right now, system repair isn't coded, but if Thom adds that, I'll probably have to add a line to tell it not to repair anything.  
 

Quote:
Originally Posted by mattssheep4

I expect that one of the AI options will be a "passive" mode where they will ignore attacks etc. 



It simplifies how much work the server has to do when it cycles the tick. 

Quote:
Originally Posted by mattssheep4

Is "Artemis Cosmos" the name Thom has settled on for A3?


That's Thom's current preference. He doesn't consider this new code to be a "new version" of Artemis 2 because he's coding the entire game with a new graphics engine from the ground up. In his mind, it's more of a complete rewrite than a new version. 

Quote:
Originally Posted by mattssheep4

At the very least I expect it'll be relatively simple to delete one game object and create a new one in its place. 


Deleting things is a bit more involved. When you create a new object, first thing you do is "make" the object, which defines the type, properties, methods, functions, etc. associated with that object. As you make it, you assign an ID or a "handle" to it so you have an easy way to "grab" that object and all the stuff that goes with it. 

Then you "get" the object by assigning the handle to a variable. Once that's been assigned, you can manipulate that object by changing the values of that variable. 

You will also likely be adding the "handle" and/or the variable to a list (or an array of some sort) so you can keep track of all your asteroids, npcships, etc. 

When you want to delete an object, you have to put a little more consideration into what you want to remove from the game: are you deleting the entire object that you created, or just the instance that you pulled into the game by assigning it to a variable? If you're just getting rid of the variable, but you still want access to the object you created (to make another asteroid or npcship later), then you probably do something to clear the variable (I think this is what "sbs.delete_object" does). If you're not going to use that object again in that script, then you might want to delete both the variable and the object data it references, so you can free up more system resources for other things. If you're deleting the space object from the sim, you will also probably need to delete the reference ID to it in whatever list you added it to, such as npcshipList[] or asteroidList[], etc.

Because of the way Python handles objects, Thom put the "delete_object" method in a different "sbs" object rather than the "sim" object. I'm assuming this is to prevent problems with how memory is allocated or freed up when the sim is running, but I don't have a firm grasp of what exactly those problems would be.    
 

Quote:
Originally Posted by mattssheep4

I had previously assumed that would be a global setting, where the number of shield facings would be the same within any given game. But having it be on a per-ship/station/other basis adds some very interesting possibilities. I'll have to be patient on this though since I kinda don't expect the initial release to deal with more than just the two facings.


Stations have a single shield. Most ships have two shields. It's an integer value, so you can set the maximum number of shields to higher if you like. Here's a list of named variables for space object data_sets:

beamCount                int                 num of beams currently on the ship/space object
beamTimer                int64     array     tick value used to wait for a ship beam to be able to fire
playerSPitch             float               pitch steering on a player ship; -1 to 1
playerSRoll              float               roll steering on a player ship; -1 to 1
playerSYaw               float               yaw steering on a player ship; -1 to 1
playerThrottle           float               throttle on a player ship; set from 0.0-5.0, anything over 1.0 is warp
shield_count             int                 num of shields this space object has
shield_max_val           float     array     most points this shield can have
shield_recharge_rate     float               how fast the shields will normally recharge
shield_val               float     array     current points left in this shield
system_damage            float     array     value of how much damage this system index has taken
system_max_damage        float     array     maximum damage this system index can take
target_id                int                 unique_ID of the space object the npc ship is supposed to shoot at
target_pos_x             float               point in space that this npc ship is supposed to move towards (x component)
target_pos_y             float               point in space that this npc ship is supposed to move towards (y component)
target_pos_z             float               point in space that this npc ship is supposed to move towards (z component)
testFloat                float
testInt                  int
testStr                  string              Mandy Patinkin, greatest entertainer evar
throttle                 float               how fast the npc ship is supposed to go; 0.0-1.0
torpedoTubeCount         int                 num of torpedo tubes currently on the ship/space object



Quote:
Originally Posted by mattssheep4

Is the "reposition_space_object" method different somehow than the "GS_Move_Object" method? Is it a built-in function that's part of the space object class, while "GS_Move_Object" more like a global function?


I'm not sure if that's a new method or if Thom just renamed "GS_Move_Object" to "reposition_space_object". Thom and Doug have had a few discussions about what the "style" should look like, such as snake_case or CamelCase. Thom was calling the sim object "theSimulation", and Doug suggested he shorten it to "sim" because it's easier to type (and less likely to be misspelled). So that may have been Thom renaming a function from something that was more functional to something that was more presentable.

Quote:
Originally Posted by mattssheep4

I'm curious about velocity changes with regards to black holes and such - it would be interesting to be able to add custom forces to an object under some circumstances. But I'm not sure that artemis, being in space, warrants somewhat complex multiple-force calculations. It would be cool to add custom things like anti-gravity bombs, which you could fire if you got too close to a black hole and would add a pushing force between you and the black hole, helping you escape.


If I have any input into black holes... {insert EEEVIL laughter}. Hmm. My guess would be Thom would leverage the nebula code to do something interesting with black holes, but I'm not sure. I do know that Thom said he can use the nebula code to do planetoids, which are basically nebula shaped like a gas giant (or mini-gas giant). Since the scale of full-size planets doesn't really work well with Artemis-sized ships, he may wind up calling them "dwarf planets" or "planetoids". Likewise, I will recommend we call black holes "micro-singularities", and I'll probably put something together with Mike to explain why they are so much more common that full-size singularities.   

Quote:
Originally Posted by mattssheep4

As a side thought - how much customization will black holes and other terrain have in terms of size, color, and (in the case of black holes) gravity magnitude? (If you happen to know).



If they are repurposed nebula, then customization will be... awesome. I'm not sure how Thom wants to handle gravity, but he tends to swing towards "interesting gameplay" rather than "realism". 

Quote:
Originally Posted by mattssheep4

I was referring to ships in particular, but it would be awesome to make custom torpedoes that do funky things like some missiles that can change velocity to evade countermeasures or surprise a foe. I've got tons of spin-off ideas but this probably isn't the place for them.

I DO very much want to have the capability to define custom torpedo variants, but I think that's been confirmed already. A couple related questions:

Right now that stuff is on the "wish list".

Quote:
Originally Posted by mattssheep4

Beams in A2 use a certain amount of energy per shot. Will this energy use be customizeable?


I haven't mucked around with the beams yet, so all I know about them is what's in the object data_set stuff. I'm not sure how you set the color. Thom's very proud of the "ripple" effect as they hit the shields, so I'll see if we can get some screenshots or a short clip of that posted somewhere. 

Quote:
Originally Posted by mattssheep4

Are there plans to make the color a defineable attribute in the ship data file?



That sounds like something that would be easy to add. I'll see if Thom can put in some variables for beam colors. 

Quote:
Originally Posted by mattssheep4

Will weapons officers be able to designate which beams to fire at a particular target, instead of always firing all beams able to hit the target?


Thom wasn't happy about how manual beams was implemented, so I think he wants to make some changes to how the weapons client works. I'm not sure what he has in mind, though. 

Quote:
Originally Posted by mattssheep4

Will npc ships be able to use torpedoes other than drones? E.g. an npc Artemis class could fire nukes, for example. I'd be happy if this wasn't the default, but could be specified via custom brain stacks.


I don't know. I would like to see something like a "weapons toolkit" where the scripters can create customized weapon effects, like bursts, MIRV, homing, shield scramble, etc., so the scripters can create their own "experimental" weapons. But that's probably not going to be high on the "wish list". 


Quote:
Originally Posted by mattssheep4

I'm curious to see what values tickType could be, and how we could use the current tickType in scripting. I'll plan on not changing it though 😋


It's something internal to the server code, and not something you'd want to mess with from the mission scripting. It's basically a reference index that tells the code if it needs to calculate damage, figure out weapon firing, moving active objects, etc. What you'll be changing via scripting is values on the space objects, and then the tickType will sort out what's happening when the tick cycles. 



__________________
Call Sign (EF/TSN): Bassellope

Xavier Wise

Registered:
Posts: 1,362
Reply with quote  #12 
Looking at the code, I would really love to have a go at writing stuff. I already have ideas in mind for terrain modules in Python that will make writing a sandbox much easier, and I can see me using a GM module as well to bring in to the main python mission script.
__________________
Fleet Captain Xavier Wise - TSN Sabre
Link to TSN RP Community Website

Want to follow development of the TSN Sandbox? Head here:
https://ko-fi.com/xavierwise
mattssheep4

Avatar / Picture

Registered:
Posts: 128
Reply with quote  #13 
Quote:
Originally Posted by Darrin
navpoint1 = sim.add_landmark(0, 0, 0, "HOME NAVPT", 1, 5, 0, 1)


Could you elaborate on what all these parameters are. The first four are pretty obvious I think - X, Y, Z and a name, but the parameters following the name are a complete mystery to me.

__________________

Captain Matthew Vaj

Former Commanding Officer, TSN Viper, 2nd Space Fleet, 4th Light Division

TSN RP Community - Listen to our Fleet News Service! - Join our Discord Server!

Intelligence Officer of the Cygnus Campaign

Darrin

Registered:
Posts: 434
Reply with quote  #14 
Quote:
Originally Posted by mattssheep4


Could you elaborate on what all these parameters are. The first four are pretty obvious I think - X, Y, Z and a name, but the parameters following the name are a complete mystery to me.


I was rather mystified by those myself. I thought they had something to do with color, as I wanted something other than red, so I tried changing them, found that changing one of them to "5" made the landmark yellow, which is the color I was looking for. Here's the documentation on the landmark object:



class landmark(pybind11_builtins.pybind11_object)
| Method resolution order:
| landmark
| pybind11_builtins.pybind11_object
| builtins.object
|
| Methods defined here:
|
| __init__(self, /, *args, **kwargs)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| color
| vec4, color on 2d radar
|
| position
| vec3, position in space
|
| text
| string, text label
|
| ----------------------------------------------------------------------
| Static methods inherited from pybind11_builtins.pybind11_object:
|
| __new__(*args, **kwargs) from pybind11_builtins.pybind11_type
| Create and return a new object. See help(type) for accurate signature.







__________________
Call Sign (EF/TSN): Bassellope

Raymus Thrax

Avatar / Picture

Registered:
Posts: 8
Reply with quote  #15 
Personally, what I’d like in Artemis 3 is a built-in level editor that I could script missions with. I’ve come up with so many ideas for fun missions with my friends, but I’ve never really understood coding or anything. A built-in UI with different actions on a timeline would be incredibly useful for people like me who have complex ideas but not the means to implement them.
__________________
“Through spiraling debris and burning wreckage soared the Vigilant, beams flying from the emitters, laying waste to the Hegemony fleet” —The Battle of Ántrax IV by Sorin Mathew
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.