Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - ninekorn

Pages: [1] 2 3 4
Ok about the energy and fuel. I'm gonna have to start looking in the CalculateShip.js to fiddle around with the "Too High" fuel consumption of the ship. I've already been able to stabilize the fuel consumption. So right now it stays at 100% almost all the time. I'll fiddle some more inside the script to get to understand where the functions are.

Here's a better view of the message. It has started 3 servers ago and now it won't stop.

There is a message in the console that is beeing displayed ever since I've created my test server today. It's never happened as much as it was doing so today. The message says
"[ERR] Ship not found: 0"
I think in the past, AI_enabled fixed one debug message like that but it was for Asteroids, if I remember correctly.
How does the fuel work in VoidExpanse?
Somehow, it feels like both the energy consumption and fuel consumption are linked together? I'm not sure if I'm wrong there.

Help section / Re: Is there a IMCache.GetValue and IMCache.SetValue?
« on: February 04, 2018, 10:35:57 pm »
yes I did. I put include(IMCache.js); right there at the top of the script!  ;D

did I miss anything?


The channel is free. I am not there to show that I am good at scripting nor to make money... I don't think I am that good. In fact I believe I have a LOT left to learn. But I made a mistake starting those mods. And that was to "disregard" the "haste" that is pretty much required for keeping an audience interested... I am talking about the community of course. It's been 6 months that I've release a video of my Galaxy Market in Void Expanse and 3 months later I had received 2 responses of the community on youtube here . Also someone was interested in my drones mod here and I didn't respond. I have been working hours upon hours trying to make the best thing possible but I've just hit a wall of reality this weekend. I mean, I wasn't focusing on the right project, my idea was wrong from the start for the Drone Formation. I mean it's still a good idea that I will "convert" for other projects but it wasn't going to be effective for Drone Formations. And so this weekend I've decided to "burn" my whole Drone Formation project V1 and start with V2. It took me 1 day to create V2 and 3-4 months to make V1. So my whole project was taking too long. The tiny pathfind got me distracted. And the function StickToPoint wasn't giving me the perfect position at the right of the player and that's why I wasn't using it. In fact, I was using my own trigonometry functions to get the formation points. I am now using StickToPoint to make the drone Formations work and I will just offset the points a little bit to increase the number of formation points near the player. I am now starting V2 with StickToPoint and the V2 project is already way more advanced than V1. This is a good sign. Here's approx my current goals and a LOT of those functions already work, if not ALL OF them:

In the Drone Formation V1: worked 30 days just on the pathfind and the rest took 3-4 months
1. All different behaviors of the drones were separated and weren't even working together yet.
2. I worked 1 whole month for the AI Simple Pathfind and was able to make it work but it was completely USELESS for the project for what I wanted to use it for. The work on it is done
    though and so I will reuse it later anyway.
3. In that month, I was also able to put the drone in formation by following the best path it found from the pathfind it generated. The path was extra small and very effective. But as I
    said I was using this whole stuff the wrong way.
4. I had made a basic "Drone Go Mine" script that was working and don't remember where I put it in 2.5 terabyte of folders and projects and backups and whatnot....
5. I had made a basic "Drone Evade Projectiles" script that was working and don't remember where I put it in 2.5 terabyte of folders and projects and backups and whatnot....

In the Drone Formation V2: worked 1 day on it and it's already better than V1

      1.1 - AI Pick Formation:
         1.1.1 - The drone can follow the player. (coded)
         1.1.1 - If the drone is too far from the player it will go back to the player.
         1.1.2 - If the drone is getting in range of the player, it will get in formation.
         1.1.3 - If the drone is In formation but is ordered to go mine or attack, it will do so. (but V2 had a bug here where you could only send it mine once, after that it bugged)
         1.1.4 - If the drone is in formation but the player is "docking", it will dock with the player.
         1.1.5 - If the drone is in formation but the player is entering a jumpgate, the drone will jump with the player. (I might switch that later so if the drones are too far from the player
                    to remove their jumping capabilities)

      1.2 - AI Go Mine.
         1.2.1 - If the drone is commanded to go mining, it will go mine.
         1.2.2 - When the drone is mining, it gets a 2 seconds delay for each mining laser activation. For the moment, each mining laser activation gives them a minimum of 10 "Glepsite".
                    To be modified later.
         1.2.3 - Each 2 seconds, the mining laser yield is full and so the drone deposits the minerals in it's own cargo. Once it's own cargo is full, it will move towards the player and dropoff
                    it's own cargo unless the player's inventory is full.
         1.2.4 - If the player's cargo is full, the drone will not "try" to empty it's mining laser "yield" on the player. It will just stop mining once it's inventory is full and then go back to
                    formation instead of mining again.
         1.2.5 - If the player's cargo is NOT full, it will stop mining, and move towards the player until it hits a certain distance from the player to where it would stop.
         1.2.6 - Once the drone is stopped near the player, it will droppoff it's materials and then BAM it returns mine...
         1.2.7 - As long as there is space in the players cargo and an asteroid to find in the system, the drone will keep mining.
         1.2.8 - The drone is stopping it's mining operation if the player is too far, and if that happens, the drone returns near the player in Formation, instead of going back to mine.

      1.3 - AI Go Pick Containers.
         1.3.1 - to fill soon.

     1.4 - AI Go Combat.
         1.4.1 - to fill soon.

I will be trying to code all nights from 09h00pm to 01h00am every night of the week and more in the weekends. I might also in the weekends. I have a job during the afternoon and so I can't work there for the moment. At some point, I might switch from night to morning.

If you people have any ideas as to how I could "better" my mods please feel free to contact me. You can also come in the TwitchTV channel and just give me a flurry of "swears" or a flurry of "you suck buddy" and that's gonna make my day!  ;D

Anyhow, it's free, and it's for Void Expanse's Community!

Help section / Is there a IMCache.GetValue and IMCache.SetValue?
« on: February 03, 2018, 06:13:03 am »

In the CaculateShip.js there is a bunch of IMCache.AddValue like:

Code: [Select]
IMCache.AddValue("maneuvering_value", 1 + lerp * 0.1);
Can we also access and modify those values IN-Game with the .js scripts?  I am trying to get more control over the drones NPC basic "settings". I've tried

Code: [Select]

var allEffects = ship.GetAllEffects();
var defaults = ship.GetDefaultEffects();
var invCache = ship.GetEquipmentCache(SHIP_ID);
var skillCache = ship.GetSkillsCache(SHIP_ID);
var buffsCache = ship.GetBuffsCache(SHIP_ID);

But only the ship.GetAllEffects() works... As in it doesn't debug an empty array. When I tried to debug the others, I get "undefined". So modifying the equipment values or skill values IN-Game doesn't seem to work for me right now. Even states that we can use SetEquipmentValue like:

Code: [Select]
ship.SetEquipmentCacheValue(SHIP_ID, "maneuvering_value", 10);
var invCache = ship.GetEquipmentCache(SHIP_ID);

But even that debugs me "undefined" so I am not sure what else to try. There doesn't seem to be a template as to how to get access to those values anywhere on the web and the wiki page.  I've searched all the other Big Mods contents with Notepad++ and no other Modders used those settings in their scripts either.

Thanks in advance for the help!

    I'd love to say that I am nearing my personal deadline to release my full mod of the game. But that would also be the first game I mod and I don't have any specific deadline. The only thing I've got are goals, as in, multiple different mods that I need to finish individually and when put together, they will make something awesome. As long as I can keep working on them, I know that I will finish them. I just don't know when. Just coding the formation stuff is awefully long, because it's the first time that I code that stuff with 1 year and 9 months of coding experience overall. But the more I code, the better I become. That's what's nice about coding, as long that we have the memory to handle what we've coded in the past, nothing is ever lost.

    Some people might say that I've planified too much for Void Expanse and it could take forever to finish all those projects but the thing is I understand javascript and c#. So as long as you guys support Void Expanse, I will keep working on those mods and as a main goal, to release the full package.

    And if someday you stop supporting Void Expanse, I will just convert what I've learnt coding Javascript for Void Expanse to c# because I know that I can do it. Hopefully, you won't have plans to stop supporting Void Expanse anytime soon. As I said once to AI_enabled, Void Expanse is just a sleeper.

    Once you guys are finally having a breather from Cryofall, I will have some requests for new API functions. Easy ones. Stuff like:

    • ship.GetForwardDirection (outputs Vector2 x and y) I could get the other directions just by switching the x and y components myself. This function will increase the potency of the drone formation. because right now I am using 2 frames to capture the direction by putting the first frame coordinates and second frame coordinates in variables... The problem is when the ship doesn't move... bam, i've got no direction except the last direction that is saved in a variable.
    • ship.GetSpeed (outputs true Void Expanse speed of the ships)
    • ship.GetCurrentRotation
    would output in radians or degrees.
    • ship.IsShipStrafingLeft and ship.IsShipStrafingRight
    would output a boolean. this will make me able to code a "mimic" function for the drones to completely "mirror" the player's movements when they get into formation. I would just need the current "real ship speed" and true "ship.GetForwardDirection" to perfectly match the player's movement, but it would be more fun if the drones strafe when the player strafes.
    • ship.IsPlayerFrontLeaping
    that's when the player is pressing the key "W" twice and the player blinks/leaps to the front. which leads to the next obvious API function.
    • ship.LeapFront

    So when you've got that tiny breather please give me a shout in private, you or AI_enabled. Until then, I will behave and won't ask for new API functions. I'm just gonna keep working with what I have  ;D

EDIT: lol i reread myself and thought that my post was rude. Sorry about that. Anyway, the moment I played the game, i just fell in love with it. Hopefully when I release the mods, it will get attention from some people, just a couple people that create servers with my mods will make me happy. I just cant wait to finish everything I have planned and release it. ;)

hmm. Ok. That's exactly the issue I had with the drone market then, until i fixed it by just fractionning the market mod in like 30 scripts instead of just 1 script. I'm gonna try stuff to see if it's gonna fix it. What I'm not sure to understand then is why the drone mod scripts would lag when there is only 8 scripts for the moment and those 8 are just for the formation behavior. 2 out of those have almost no code inside of them.

-_- lol and I was so proud to have found an alternative. awww man. It wasn't even this causing my lag issue anyway. It's a tiny lag spike just when the AI's pathfind activates the first time and then it doesn't lag at all. I've kept a backup of the whole sqrt script but it was actually 6 Math.sqrt per 20 decisions per second per drones. It wasn't activating all sqrt per decisions, but maybe half so 10 * 6 = 60 Math.sqrt calls per drones per second. Maybe it's my "sort" function or "contains" function. I'm gonna test some more before I head into the drone "control drift" stuff.

Thanks AI

I got it  ;D

I am getting the player direction from a custom function I've made and then just putting the direction in variables and also getting the "right direction":

Code: [Select]
var forward = { x: playerDirection.x, y: playerDirection.y };
var right = { x: playerDirection.y, y: -playerDirection.x };

Then I am getting a point from a circle of radius 5 to the right of the player. This point is "static"...

Code: [Select]
var pointRightX = (5*  Math.cos(0 * Math.PI / 180)) + playerCoord.x;
var pointRightY = (5 * Math.sin(0 * Math.PI / 180)) + playerCoord.y;

Then I just create a direction from that point:

Code: [Select]
var dirRightX = pointRightX - playerCoordinates.x;
var dirRightY = pointRightY - playerCoordinates.y;

Then I'm using this snipet of code to give me the angle in degrees between the right direction of the player and the direction to the static point at the right of the player:

Code: [Select]
var angleDeg = ((Math.atan2(right.y, right.x) - Math.atan2(dirRightY, dirRightX)) * 180) / Math.PI;

Then I am again calculating the point on the diameter of the circle of radius 5 with the above angle in degrees with this:

Code: [Select]
var rightWaypointX = (5 * Math.cos(angleDeg * Math.PI / 180)) + playerCoordinates.x;
var rightWaypointY = (5 * Math.sin(angleDeg * Math.PI / 180)) + playerCoordinates.y;

No need to normalize anymore. There is no need to use Math.sqrt. I have got no clue though if it's gonna be more performant then Math.sqrt...

I had to search the web and found those two references that helped me:

Thanks for the quick reply AI!

I'm gonna start working on that. I thought that I needed to normalize the vectors before doing the Dot product. Here is the function that I was using to calculate the Dot product which is exactly the one you just mentionned... It also happens that the function is from a reference website you had given me in earlier posts.

Code: [Select]
Dot: function (aX, aY, bX, bY) {
return (aX * bX) + (aY * bY);

Also I've found that other reference for the fast sqrt stuff that i've got no idea how to implement anyway and that I probably don't even need to use anyway.

oh and ... I was actually using 6 Math.sqrt for all the things to work... I am now trying to remove 5 of them with your suggestion. I'm still not sure though about normalizing them or not but I do need to normalize the formation position near the player though which requires 1 Math.sqrt.

Hi anyone who will read this.

I've been working my ass off for 1 month ever since 24rth December to try and get the Drone Mod going forward. I already had a LOT of functions for the Drone Mod working like:

1. drone, go pick near containers,
2. drone, go mine,
3. drone, go empty inventory,
4. drone, go attack enemies in range,
5. drone, follow player,
6. drone, go repair yourself if not at full hp,

but without the drone formation function, the drones would just hit each other and collide with everything around them and just it wasn't really nice to watch.

And as AI_enabled suggested to me for the drones, Drone Formations would be a great idea. Things are getting great after one month of working hard on it. I've decided to implement a simple, very very simple pathfind, that just activates when the Drone is 5-10 Void Expanse Units distance from the player. This pathfind is NOT a grid 10*10 or whatever because that would've been too much overhead if a lot of Drones on the server. It's actually a simple pathfind that iterates a selected number of times and gets the 8 neighboors out of where the Drone is and right away calculates the best node gcost - fcost - hcost. This makes it so that instead of generating a whole 10*10 grid and applying the whole gcost etc to all of those nodes, it just applies those "costs" to the neighbooring nodes and selects the best node out of that pile and just removes the rest... I make it iterate 5 times for the moment and it's VERY effective to get the drone in position (of course, I still need to code the drone speed and make it use it's thrusters to get in position near the player)... But there is an issue. I am making 3 calculations using Math.sqrt to get the length of Vector2d needed for the drone to calculate the dot product... It's complicated to explain but anyway... I've got that whole part working but you must imagine that 3 sqrt per 20 decisions per seconds is 60 sqrt calculations for each drone per seconds WHEN the drone activates it's pathfind... Which is without a doubt, out of the question, to be in the final version of the drone mod. I mean this isn't a single player game so 100++ drones would maybe/probably make the server lag ... And so searching the web to find a solution, i've stumbled upon the FAST Quake 3 inverse Sqrt function that doesn't make use of Math.sqrt. But the thing is Void Expanse, as mentionned by AI_enabled, uses ECMASCRIPT 5 (strict mode). And things like:


aren't recognized by ECMASCRIPT5 which makes all of those following reference functions not work...

This is complicated stuff for me at my current scripting experience and so if any of you guys in this community know what the heck I am talking about (because even I don't really understand those functions anyway), please feel free to give me some hint as to HOW I could calculate a position next to a player by normalizing a Vector2d without using Math.sqrt.
The way that I am doing it works but it is bound to lag if there is a LOT of drones on the server. I am going to keep working on the Drones for sure because whatever I learn while coding some AI stuff is not a loss to me, on the contrary, because I am pretty sure I could convert my whole scripts to C# anyway when I code in Unity3d.

So yeah, the moment that the drones get in formation and that it doesn't lag the moment that they first activate their pathfind (it doesn't lag after the first pathfind generation somehow), then I will start coding the Drone "control drift" function so that the drone itself uses it's thrusters to get to it's formation position at the fastest speed possible by using the path it generated from it's pathfind.

Anyway, to anyone who read this,
Thank you in advance.

Bug reports / Re: Too many Heap sections crash!
« on: December 28, 2017, 02:03:06 am »
Yeah you're right! Well that's gonna give me time to work on my other mods! So it's perfectly fine. I don't think the market mod would work with the vanilla steam server so i'll just wait for the patch release to release my stuff.

Bug reports / Re: Too many Heap sections crash!
« on: December 27, 2017, 07:12:00 am »
Nevermind AI I thought it was my market mod that had caused the crash and I posted in the wrong section of the forum my reply (in the help section).

I mean I did make a mistake causing server lag because of my arrays but the "Too many heap section" crash occured also this morning even with my market array fixed... So its probably/certainly due to what you described. Except from that... I am very happy to say that my market mod is nearing release. Both Buying and Selling sections are working, now I just have to fix some text issues.



I have tested again this crash and found out the problem was on my market mod. I had put in the function SetResourceBasePrice that when the price was NOT defined to ALSO put the cargo items in the global arrays... So at every station shop updates in the game all the items were added again and again and again... After a couple hours there must have been thousands and more in that global array and everytime that I added something I also fetched the array to put items into it and then set back the array in the global array.... Even after 5minutes with the game running the game was skipping frames like crazy... So that's my bad. sorry


Bug reports / Too many Heap sections crash!
« on: December 26, 2017, 06:42:18 am »
Hi guys, I have no clue what happened as I left my private server and game opened for the night. When I woke up this morning I had a Void Expanse crash. I wonder if it's due to my market mod? It worries me a bit since I have cleaned the 17 scripts that make the buy section of the market mod and got rid of every uneeded functions and variables and arrays and also I've removed all hiddenInStationNPCs from the game to just spawn a series of 15 of them in the starting station to test the market mod. The market mod was running fast but it seems that there is something that lags the server periodically... I have no clue if it's my market mod. I have put a sharable link of my google drive for the too many heap sections crash report. When you guys have the time to look at it.

Thank you!

Pages: [1] 2 3 4