Welcome to Keen Software House Forums! Log in or Sign up to interact with the KSH community.
  1. You are currently browsing our forum as a guest. Create your own forum account to access all forum functionality.

Scavenger World Server.

Discussion in 'Multiplayer' started by Ronin1973, Mar 21, 2016.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Mr Ixolate Apprentice Engineer

    Messages:
    276
    Just had a random though: platforms have to be 75m above the ground,would a cliff base have to extend the same distance out from the cliff?

    Playing on triple earth and seeing all the gorges made me think it would be a waste not to have a few cliff bases.
     
  2. Ronin1973 Master Engineer

    Messages:
    4,824
    The first test base I laid down was on a cliff with drones flying through the gorges. Hell yes...
     
  3. B0mm3l6 Trainee Engineer

    Messages:
    33
    ... Challenge accepted
     
  4. Flarefire Trainee Engineer

    Messages:
    42
    I've just updated my latest drone AI prototype. It's still far from perfect, but already pretty cool imho. With some more work it'll be ready to open a tin of whoop-arse on anyone who threatens the space (planet?) pirates.

    Current features:
    • Four states: Patrol, Hunt, Combat and Disengage.
      • In patrol mode, follows a pre-programmed patrol route and scans for players.
      • In hunt mode, chases down the nearest player.
      • In combat mode, holds position and opens fire.
      • In disengage mode, floats upwards 100 meters and resumes its patrol.
    • Fixed guns. It'll aim them. And shoot them. And kill you (or waste ammo trying).
    • "EXTERMINATE!": The drone communicates its intentions via beacon and light colours.
      • If it's green, it's looking to be mean.
      • If it's red, you're dead.
      • If it's yellow, it's feeling mellow (after killing you).
      • If it's orange... ehh... you're out o' range?
    You can find it here: https://steamcommunity.com/sharedfiles/filedetails/?id=667943174
     
    Last edited: Apr 22, 2016
    • Like Like x 2
    • Funny Funny x 1
  5. Ronin1973 Master Engineer

    Messages:
    4,824
    I'm working on my drone logic as well... if it detects a player it will go after them, but lay down a breadcrumb trail to follow back to the patrol route once the player is out of range or dead. So, yes, I'm still working on the server and I have a week off starting tonight so I can really push on putting this thing up. I'm committed.

    You guys are awesome, especially Flare and B0mm. Let me know if there's anything you guys need from me.
     
  6. B0mm3l6 Trainee Engineer

    Messages:
    33
    An accepted friend request on steam ^^

    And i am working atm on another SPRT-Base
     
    • Like Like x 1
  7. Ronin1973 Master Engineer

    Messages:
    4,824
    @Flarefire

    So here's my script as it stands. I also have to update my flowchart as I moved a couple of variables around. I have to retest it in the morning when I'm not so tired. I haven't gotten it to work yet. But I think I'm getting closer. Feel free to check it for me if you have a minute.

    https://drive.google.com/file/d/0B-U22UHuVrxMOWhlUmdrRjAzN3c/view?usp=sharing
    Code:
    
    
    List<Vector3D> breadCrumbs = new List <Vector3D>(); 
    List<IMyTerminalBlock> list = new List<IMyTerminalBlock>(); 
     
     
    void Main(string argument) 
    { 
        var remoteMain = GridTerminalSystem.GetBlockWithName ("RC [Main]") as IMyRemoteControl; 
        var remoteAux = GridTerminalSystem.GetBlockWithName ("RC [Aux]") as IMyRemoteControl; 
        var remoteHunt = GridTerminalSystem.GetBlockWithName ("RC [Hunt]") as IMyRemoteControl; 
        var timerWaitLong = GridTerminalSystem.GetBlockWithName("TB [Wait Long]") as IMyTimerBlock;
    //TB [Wait Long] Waits 3 minutes then triggers TB [Resume]
    //TB [Resume] turns off AutoPilot on RC [Hunt]+ [Aux] and on for RC Main, runs this PB with argument PassiveSearch
    
        var timerActiveSearch = GridTerminalSystem.GetBlockWithName("TB [Active Search]") as IMyTimerBlock;
    //Note:  Set-up this TB to 1 second and to run THIS PB with the argument ActiveSearch   
    
        var timerPassiveSearch = GridTerminalSystem.GetBlockWithName("TB [Passive Search]") as IMyTimerBlock;
    //Note:  Set-up this TB to 4 second and to run THIS PB with the argument PassiveSearch
       
     
        string waypointName = ""; 
        Vector3D origin = new Vector3D(0, 0, 0); 
        Vector3D player = new Vector3D(0, 0, 0); 
    
        GridTerminalSystem.GetBlocksOfType<IMyBeacon>(list);   
        var droneBeacon = list[0] as IMyBeacon; 
       
        origin = Me.GetPosition();
        bool success = remoteHunt.GetNearestPlayer(out player);
         
         
        switch (argument) 
        { 
         
        case "ActiveSearch": 
     
             
            if (success) 
            { 
                //Player Is Out Of Range. 
                if (Vector3D.DistanceSquared(player, origin) > 20000 * 20000) 
                 
                { 
                breadCrumbs.Reverse(); 
                remoteAux.ClearWaypoints(); 
                    for (int i=0; i< breadCrumbs.Count; i++) 
                        { 
                        waypointName = "Return " + i.ToString(); 
     
                        remoteAux.AddWaypoint(breadCrumbs[i], waypointName);     
                        } 
                breadCrumbs.Clear(); 
                remoteMain.SetAutoPilotEnabled(false); 
                remoteHunt.SetAutoPilotEnabled(false); 
                remoteAux.SetAutoPilotEnabled(true); 
                droneBeacon.SetCustomName("Beacon"); 
                timerWaitLong.ApplyAction("Start"); 
                } 
                 
                //Player Is In Range. 
                else 
                   
                { 
               
                breadCrumbs.Add(origin); 
                remoteHunt.ClearWaypoints(); 
                remoteAux.ClearWaypoints(); 
                remoteMain.SetAutoPilotEnabled(false); 
                remoteAux.SetAutoPilotEnabled(false); 
                remoteHunt.AddWaypoint(player, "Player"); 
                remoteHunt.SetAutoPilotEnabled(true); 
                timerActiveSearch.ApplyAction("Start"); 
                } 
            } 
             
        break; 
         
        case "PassiveSearch": 
             
            if (success) 
            { 
                if (Vector3D.DistanceSquared(player, origin) > 20000 * 20000) 
                //Player Is Out Of Range. 
                { 
                timerPassiveSearch.ApplyAction("Start"); 
                } 
                 
                else 
                  //Player Is In Range. 
                { 
                remoteMain.SetAutoPilotEnabled(false); 
                remoteAux.SetAutoPilotEnabled(false); 
                remoteAux.ClearWaypoints(); 
                remoteHunt.ClearWaypoints(); 
                breadCrumbs.Clear(); 
     
                droneBeacon.SetCustomName("Target Acquired"); 
                timerActiveSearch.ApplyAction("Start"); 
                } 
             
             
            } 
           
         
        break; 
         
         
        case "AvoidCollision":
       
          	    origin = Me.GetPosition();
    	        remoteAux.ClearWaypoints();
    	        remoteAux.AddWaypoint(origin, "Waiting Here");
    
        break; 
         
         
         
        } 
     
    } 
    
     
  8. Flarefire Trainee Engineer

    Messages:
    42
    I'm playing around with it right now. The main issue I see is that the script stops doing anything if no player is found during active or passive search (because no timers are started). With the logic below, the drone works for me.

    Something else I've noticed is that the drone has trouble following the path back, likely because it's dropping too many breadcrumbs. The autopilot tries to pass its remote through each waypoint, which causes it to lower its speed and yaw excessively. It'll get there eventually, but it's slow going. I'd suggest dropping a breadcrumb every half minute or so and see how that goes.

    Finally, the drone stops looking for enemies while it's following its breadcrumb trail back. If it's a long trail, that makes it passive and vulnerable to sniping for quite a while. A player could exploit this by kiting the drone past their med bay, then suiciding and intercepting the drone.

    Code:
        case "ActiveSearch":
            if (!success || Vector3D.DistanceSquared(player, origin) > 20000 * 20000)
            {
                // No nearby player: Follow breadcrumb trail back.
            }
            else
            {
                // Nearby player found: Chase and lay breadcrumb.
            }
        break;
      
        case "PassiveSearch":
            if (!success || Vector3D.DistanceSquared(player, origin) > 20000 * 20000)
            {
                // No player nearby: Continue search.
            }
            else
            {
                // Nearby player found: Start breadcrumb trail and chase.
            }
        break; 
     
  9. Silenthunter Trainee Engineer

    Messages:
    25
    Here's a second drone for consideration for the server. It has 3 Gatling turrets and 2 medium cargo containers. It also has 2 PB/times that are not currently programmed with anything.

    [​IMG]a

    Steam Workshop Link: Odyssey
     
  10. B0mm3l6 Trainee Engineer

    Messages:
    33
    It's an UFO :O
     
  11. Ronin1973 Master Engineer

    Messages:
    4,824
    @Flarefire

    I'm going to try this out right now. The coding is for a patrol drone that flies the same path as the unarmed drones. They're meant to be reasonably easy to take out if you have enough weaponry or skill. I did want the drone to be vulnerable on its way back to it's origination point. Players who are just starting out will have to deal with them if they're not careful and probably be only armed with a small turret. So the drone will probably only have two small turrets on it and lots of weak spots. Can't make them too tough else people will rage quit. :)
     
  12. Ronin1973 Master Engineer

    Messages:
    4,824
    Sweet. So I went through B0mm's larger tower and configured it for game use. It's available privately through my workshop.

    http://steamcommunity.com/sharedfiles/filedetails/?id=671523140

    The name of the tower is AdamPrime.

    The way the layouts will work: every related group of towers will have a name that begins with a letter of the alphabet: Adam, Bartholomew, Charles, etc. The main tower will have a surname of Prime. So this tower's name is Adam Prime. The satellite towers will have a surname of Alpha, Beta, Gamma, Delta, etc. So the first satellite of Adam Prime will be named Adam Alpha.

    For the first installment, there will be four main towers: Adam and three others. They will be spaced equally apart from each other. Surrounding each of them will be four satellite towers. In the center will be one main base that's yet to be built. The satellites will feed their related Prime and the Primes will feed the main base. Even though this is a 3x planet, the layout will consume a good chunk of the planet. I've already mapped out where the Primes are going and the Main base.

    To add some interest, I'm thinking about creating one Prime and it's satellites. Then blueprinting other objects with a Tyrsis nanite welder attached to it with a couple of connectors and a projector. So during server play the Space Pirates will be actively building additional bases. As a drone lands on the nanite builder it will trigger a timer to start and stop the nanite welder. It will then build as much of the base as possible from its current inventory until the timer turns it off. This will repeat for each time a drone docks with it.

    My thought here is to allow players to decide how to take on the Pirates. They are obviously building up their planet... in order to do SOMETHING (keeping that a secret so I can figure it out later but I have a couple of ideas. :)

    Slowing down their construction be a goal of the game (to create interest).

    ------------------------

    Drones: Thanks so much to FlareFlame for sorting out my script. It will govern patrol drones that fly the same routes as the cargo drones. Be careful if you're thinking of ambushing a cargo drone. It might turn out to be a patrol drone and ruin your day. Cargo drones will also have a 1/100 chance of spazzing out and randomly crashing at every waypoint. So if you're not strong enough to cripple a drone enough to get it to crash, you might get lucky and find one that has done that on its own.

    As I said before: drones of all types will only spawn when a player is close enough to a tower. Towers that have no active players near them won't spawn drones. This will keep the number of drones active at one time down to the areas where players are active.

    I'm thinking of speaking to @Pennywise and perhaps adapting his planetary mining drone to Space Pirate use. I'd have to program the places where ore is found myself. But having the Space Pirates mining, refining, and producing their own components from scratch would add a bit to the immersiveness of the game. The mining stations would be built on the edges of ore fields and drones would service them by moving the ore to the nearest satellite. The mining stations would have weaker defenses than the satellite towers.

    I have a copy of the "virgin" planet, so if the world file gets too big, I can just swap it out to reduce size.

    ------------------------

    On my to do list for today.
    1. See how @B0mm3l6 is coming along with his revised tower. I'm excited about it. I may keep the original as well as the updated version for some variety. But either way... awesomeness.
    2. Put the server back up with the new world map in creative mode for those who want to contribute to development. There are requirements to get on the creative server due to it being a creative server and we're building/planning the actual server on it.
    If I get enough interest in the creative side of things, I'll just build another server entirely so we can keep it up 24/7 for those who enjoy planning, building, and adding to the game. It'll be a "ghost-town" version of the survival world. It's a bit of cash, but this is an expensive hobby built around a $20 game. LOL.
     
    • Like Like x 1
  13. Ronin1973 Master Engineer

    Messages:
    4,824
    Oh... and I need some suggestions for the name of the server. We can't call it "Scavengers Of Dantus" anymore because... well there's no Dantus on the map!

    Though Dantus might make an appearance later on, depending if @rexxar blesses us with a mod to SESE that allows for planetary cargo ship spawning. But I think he has his hands full right now dealing with some changes to the code-base from the latest update. I don't see a donation button for SESE, but if someone finds it... maybe we should pay it a visit as a group if we want planetary cargo ship spawning... nothing better to inspire some one than to be a patron.
     
  14. rexxar Senior Engineer

    Messages:
    1,530
    I don't generally like to advertise it, but I do have a donation link when people ask: http://paypal.me/rexxar

    Ronin, if you want planetary cargo ships, pester me on discord now and again. I tend to forget requests, so if you want something from me, you need to remind me occasionally :p
     
  15. Ronin1973 Master Engineer

    Messages:
    4,824

    I decided to pester you by other means.
     
  16. rexxar Senior Engineer

    Messages:
    1,530
    Wow, okay. Thanks :)

    Essentials is updating Monday with a bunch of fixes and stuff; I'll put cargo ships in there. For now it's just going to revert to the old logic that didn't check for gravity. Eventually I want to add a second timer that drops them straight down near the player. I'm not sure when I'll get that working though. Any other requests? :p
     
  17. Ronin1973 Master Engineer

    Messages:
    4,824

    You'll get it done when you get inspired to do it. Programming is art.
     
  18. Mr Ixolate Apprentice Engineer

    Messages:
    276
    Would it be possible to slightly lower the density of the flora to make driving a little less of a challenge?


    Also, do the connectors need landing pads? I was thinking for the smaller bases that they could perhaps just have spires that rise up instead of the whole base.
     
    Last edited: Apr 24, 2016
    • Agree Agree x 1
  19. Ronin1973 Master Engineer

    Messages:
    4,824

    Spires would be interesting, but players will be attacking the base. A sheered off spire would crash through whatever is below it. So it would have to be very durable.
     
  20. Ronin1973 Master Engineer

    Messages:
    4,824
    Update:

    So I'm busily working on the server with @B0mm316 . We're getting a lot done as well as finding out some short-comings of autopilot. We engineered around it though!

    Here are some screen shots of what you might find on the server... but I doubt you'll get close enough to see it this well.



    We have some of the individual bases placed and mapped for the drones. The drone in the picture is a test-bed and used for mapping connectors. The final won't feature a cockpit.

    I also included shots of a dev area with a copy of B0's initial designs... more great things to come from him. There is also a shot of our temporary base/spawn area with a couple of drones as well as some ships for mapping.

    I'm looking for someone who wants to help out and serve as "Pathfinder." You will be responsible for mapping drone paths between bases, finding interesting routes and keeping the drones low enough that they can be attacked by players from the ground. You'll also run the drones through the pathing to make sure they don't crash or get confused.

    I'm looking for someone who's spent some time on the Scavenger server. You'll also be able to contribute any other way that you wish: drone design, base design, ideas, scripting, etc. But for right now, I need a pathfinder.

    PM me if you're interested. Contributors get credit in the Hall of Valhalla.
     
    • Like Like x 1
  21. Flarefire Trainee Engineer

    Messages:
    42
    Wow, great work you two. Especially that mountain peak station, it looks amazing ;)
     
    • Agree Agree x 1
  22. Silenthunter Trainee Engineer

    Messages:
    25
    That just looks amazing!! Imagine getting my rear handed to me getting anywhere near that thing
     
  23. Ronin1973 Master Engineer

    Messages:
    4,824
    Looking at the level of progress, I'm estimating we'll have the first playable iteration up this weekend. I just mapped 270 GPS Waypoints covering way over 1,000 km and had the autopilot fly ALL of them without crashing into anything.

    Punchlist of things to do:
    Tweak drone AI: thin out breadcrumb data, replace excess timer blocks with programmable block code.
    Adapt PennyWise's miner as Space Pirate mining drone.
    Build Space Pirate's main base (may become a work in progress on the live server)
    Build large block hunter drones and other nasties.
    Incorporate Honey Badger spawn ship (may or may not be parachuted in)
    Create definitions for Pirate Antennas
     
  24. Flarefire Trainee Engineer

    Messages:
    42
    If nothing comes up I'll work on some improved pirate antenna logic tonight. The prototype I posted earlier was just a proof-of-concept, I'm aiming for a system that'll work off a single timer, PB and antenna per base.

    Just let me know if you want any particular features or behaviour from the spawner program :)

    Update: Had a friend over this evening, but I did make some progress after he left. Will post the new script as soon as it's fully functional.
     
    Last edited: Apr 27, 2016
    • Like Like x 1
  25. Mr Ixolate Apprentice Engineer

    Messages:
    276
    Mining outpost base nearly done, just need to set up the sorters and some other stuff.

    [​IMG]
     
    • Like Like x 1
  26. rexxar Senior Engineer

    Messages:
    1,530
    @Ronin1973 If you didn't see, I updated Essentials yesterday, and you can crash cargo ships again.
     
    • Like Like x 1
  27. SayHi2Jesus4Me Trainee Engineer

    Messages:
    24
    I've been tinkering around with a small drone that could be used with a gatling gun that can be deployed from a larger ship or platform. Right now the script just shoots the gun if there is a player within a cylinder in front of the drone. Maybe combined with the assailant's script it could work (though I don't know how many more programmable blocks or timer blocks it would take). I was also wondering if getting the position of the player via GetNearestPlayer() needs to be replaced with something to detect player owned grids (like player-operated drones).

    Anyway, the drone is in my workshop called the Mite. http://steamcommunity.com/id/SayHi2Jesus4Me/myworkshopfiles/?appid=244850

    Here's the script for anyone interested in tinkering with it.

    Code:
    // name of the guns to be fired
    string gun_name = "Gatling Gun";
    // name of the timer block set to run the programmable block with this script
    string timer_name = "TB - Shoot";
    // no need to edit below here
    const double ENGAGEMENT_RANGE = 100.00d;
    const double ENGAGEMENT_RADIUS = 5.00d;
    
    bool _canFire = false;
    bool _isShooting = false;
    
    List<IMyTerminalBlock> guns = new List<IMyTerminalBlock>();
     
    void Main()
    {
        // find all guns
        GridTerminalSystem.SearchBlocksOfName(gun_name, guns);
        if (guns.Count < 1)
            Echo("No guns found on the grid.");
        _canFire = TargetInConeOfFire();
        if (_canFire)
        {
            if (!_isShooting)
            {
                foreach (IMyTerminalBlock block in guns)
                {
                    block.ApplyAction("Shoot");
                }
                _isShooting = true;
            }
        }
        else if (_isShooting)
        {
            _isShooting = false;
            foreach (IMyTerminalBlock block in guns)
            {
                block.ApplyAction("Shoot");
            }
        }
        repeat();
    }
    
    // restart this script 
    void repeat() 
    { 
        List<IMyTerminalBlock> timers = new List<IMyTerminalBlock>(); 
        GridTerminalSystem.SearchBlocksOfName(timer_name, timers); 
       
        if(timers.Count>0) 
            timers[0].ApplyAction("Start"); 
        else 
            Echo("No timer named " + timer_name + " found in the grid.");   
    }
    
    bool TargetInConeOfFire()
    {
        bool canShoot = true;
        List<IMyTerminalBlock> blocks = new List<IMyTerminalBlock>();
        GridTerminalSystem.GetBlocksOfType<IMyRemoteControl>(blocks);
        if (blocks.Count == 0)
        {
            Echo("No remote blocks found in the grid.");
            return false;
        }
        var remote = blocks[0] as IMyRemoteControl;
        blocks.Clear();
        GridTerminalSystem.GetBlocksOfType<IMyProgrammableBlock>(blocks);
        if (blocks.Count == 0)
        {
            Echo("No programmable blocks found in the grid.");
            return false;
        }
        var progBlock = blocks[0] as IMyProgrammableBlock;
        Vector3D remotePos = remote.GetPosition();
        Vector3D origin = new Vector3D(0, 0, 0); 
        Vector3D player = new Vector3D(0, 0, 0);
        origin = Me.GetPosition(); 
        bool success = remote.GetNearestPlayer(out player);
        if (!success)
        {
            Echo("Could not find a player.");
            return false;
        }
        Vector3D dir = (origin - remotePos);
        Vector3D dirNormal = Vector3D.Normalize(dir);
        Vector3D playerMinusOrigin = player - origin;
        var coneDist = Vector3D.Dot(playerMinusOrigin, dirNormal);
        Echo(coneDist.ToString());
        if (coneDist < 0 || coneDist > ENGAGEMENT_RANGE)
        {
            Echo("Target not in range.");
            Echo(coneDist.ToString() + " < 0 || > " + ENGAGEMENT_RANGE.ToString());
            return false;
        }
        var orthogonal = ((playerMinusOrigin) - (coneDist * dirNormal)).Length();
        Echo(orthogonal.ToString());
        if (orthogonal > ENGAGEMENT_RADIUS)
        {
            Echo("Target outside of cone");
            Echo(orthogonal.ToString() + " > " + ENGAGEMENT_RADIUS.ToString());
            return false;
        }
        return canShoot;
    }
     
  28. Ronin1973 Master Engineer

    Messages:
    4,824

    Before you go any further:

    I looked at your initial script for the armed drone. Oh wow... very nice.

    You should log on to the server and chat some. I have the cargo drones and a patrol drone programmed and set up to fly around the planet. There may be some things you want to add or don't need. My programming skills are about the level of dirt but I'm making it work.

    Contact @B0mm3l6 for details of how to log on to the creative. I can't give you the IP address etc., since I am behind the firewall/router. Or you can just use Steam to join me while I'm on the server and favorite it.

    We haven't set up drone spawning yet but included four antennas on every base that are open for spawning. My initial idea: 1 antenna for cargo drone spawning and patrol drones, 1 antenna for the first layer of base defensive spawning, 1 antenna for the final layer of base defensive spawning, the last antenna is a spare if we need it for future use.

    I'm also including two text panels on drones Text panel [RX] and Text panel [TX]. For the future, I'm thinking that drones can courier messages between bases. Each drone has a home base. Example: "Hey I need 100 rounds of missile ammo. I fell below my quota." When a cargo drone docks, that message is written to its TX panel. When it reaches the master or regional base, the message is read and the components are loaded on board (or at least as many as will fit). The master base then clears the RX message and writes a new one if applicable. "Send more magnesium, and Gatling ammo. I'm below quota." Other examples: "Send repair drone (Tyrsis nanite mod), we've taken damage along with these parts for repair." This is something I want to try in the future if possible but it's not necessary for the first iteration of the server. It will be continually improved and a great test bed for drone scripting.
     
  29. Ronin1973 Master Engineer

    Messages:
    4,824
    Liking it. It's different than what we have... and that's a good thing. We're looking to make bases that are different from each other so that we're not rubberstamping them all over the map and that players have to take different strategies when taking them on. Example B0 has bases that mount vertically and horizontally (there are some magnificent cliffs in a 3x earth-like world).

    I do think I will definitely need a mining base in the near future.

    There are a couple of changes that I'd like to see, but they are minor.

    Please include a total of four antennas on the base.

    Also include a handful of interior turrets on the outside to deal with players sneaking up and dodging the larger turrets. There should be some on the interior as well if you've designed player areas.

    Finally, big thing. I also need a vertically mounted connector for the actual mining drone. It should be designed to work with @Pennywise 's Octupus Miner. I'm going to mod the miner as well as add some asteroids to the planet's surface that the Octupus can detect from the air. The asteroids will be painted to blend in with the surface but serve as detectable patches of ore for the Octopus to discover and mine.

    http://steamcommunity.com/sharedfiles/filedetails/?id=619449097&searchtext=Pennywise
     
  30. Ronin1973 Master Engineer

    Messages:
    4,824
    How has target testing gone on this? From what I've seen, atmospheric drones like to fly level. Can you hit a ground target with a drone or a flying target at a different elevation?
     
Thread Status:
This last post in this thread was made more than 31 days old.