Page 4 of 24 FirstFirst ... 2345614 ... LastLast
Results 46 to 60 of 354

Thread: Bad Company Manager (ApiMod for Servers)

  1. #46
    Tracker BeatKidz's Avatar
    Join Date
    Oct 2015
    Location
    East Coast USA
    Posts
    240
    Rep Power
    1
    Quote Originally Posted by Guppycur View Post
    Have y'all seen anything that would allow for an observer mode? Log in as an invisible whatever, who can attach themselves to another players 3rd person perspective?
    I haven't come up with anything like that yet. But If I do i will be sure to let you know

  2. #47
    Colony Founder StompyNZ's Avatar
    Join Date
    Apr 2015
    Posts
    3,778
    Rep Power
    1
    Quote Originally Posted by Guppycur View Post
    Have y'all seen anything that would allow for an observer mode? Log in as an invisible whatever, who can attach themselves to another players 3rd person perspective?
    moving the player can only be done via a teleport from what ive seen. It might be possible to use a push effect, but thats getting pretty technical and not an easy one to solve.

  3. #48
    Colony Founder StompyNZ's Avatar
    Join Date
    Apr 2015
    Posts
    3,778
    Rep Power
    1
    Quote Originally Posted by BeatKidz View Post
    Yes I see all the Particle Spawning methods in GameManager I just can't figure out which method to use to create a new ParticleEffect class. Making the ParticleEffect that will be spawned.

    And on the crash when spawning mobs. Nothing in the logs. It was the weirdest crash i have seen. The server just quit working and it asked me to send a report to developers. It took awhile to track what was causing it since it was so random. I'm guessing it has something to do with the main thread iterating over the entity list while i was changing it from a separate thread. not 100% sure though
    Without testing I would guess just calling new ParticleEffect() would do it.


    something like:
    new ParticleEffect("impact_organic_on_earth", (Vector3)pos, (float)1.0, Color.white, string.Empty, "p_", false)

    I've tested the spawning thing and I think you are right about it being a case of changing the entities list while the main process is trying to read it. I have my thread call wrapped in a try/catch and that doesn't catch the exception so its happening in the main thread in a place that doesn't have exception handling.

    I'll have a go with the queue idea and see if that works better.

  4. #49
    Tracker BeatKidz's Avatar
    Join Date
    Oct 2015
    Location
    East Coast USA
    Posts
    240
    Rep Power
    1
    Quote Originally Posted by StompyNZ View Post
    Without testing I would guess just calling new ParticleEffect() would do it.


    something like:
    new ParticleEffect("impact_organic_on_earth", (Vector3)pos, (float)1.0, Color.white, string.Empty, "p_", false)

    I've tested the spawning thing and I think you are right about it being a case of changing the entities list while the main process is trying to read it. I have my thread call wrapped in a try/catch and that doesn't catch the exception so its happening in the main thread in a place that doesn't have exception handling.

    I'll have a go with the queue idea and see if that works better.
    No luck yet =( Not getting any errors but no particles yet either.
    Code:
    try
    {
          Quaternion _new = new Quaternion(0f, 0f, 0f, 0f);
          ParticleEffect _pe = new ParticleEffect("p_burning_barrel", player1POS, _new, 1.0f, Color.white);
          GameManager.Instance.SpawnParticleEffectServer(_pe, _cInfo.entityId);
    }
    catch (Exception e)
    {
          Log.Out("Error in Spawning ParticleEffect: " + e);
    }

  5. #50
    Colony Founder StompyNZ's Avatar
    Join Date
    Apr 2015
    Posts
    3,778
    Rep Power
    1
    After a lot of trial and error I've come to the conclusion it was my call to the EntityFactory was being a problem inside the thread.

    Entity _entity = EntityFactory.CreateEntity(entityClassID, pos);

    Even with almost everything else pushed out to the API.Update class calling this in the heartbeat thread was causing the random crashes after about 20 zombie spawns on average.

    The crash logs often mentioned physics and colliders being the root function being executed at the time of the crash.

    Once I moved that into the api update and just used the heartbeat thread to push the required classid and pos into a queue that the api update locked I had no problems

    Over 250 zombies and still spawning.

  6. #51
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Houston-ish, Texas
    Posts
    17,396
    Rep Power
    1
    Make them umas.

  7. #52
    Tracker BeatKidz's Avatar
    Join Date
    Oct 2015
    Location
    East Coast USA
    Posts
    240
    Rep Power
    1
    Very nice. I'v got Mobs spawning no problem so far. Built a minion system

  8. #53
    Colony Founder StompyNZ's Avatar
    Join Date
    Apr 2015
    Posts
    3,778
    Rep Power
    1
    Quote Originally Posted by icedsun View Post
    I'm new to reverse-figuring these types of things out. I saw the WorldChunkCache.AddChunkSync() function, but I don't know what object to attach it to. (Tried everything I could think of under GameManager.Instance but couldn't figure out where it should go.) Maybe GameManager.Instance.World.m_ChunkManager has a function that would work?

    Can you spawn an entity into a chunk that's not loaded? I thought of that kind of workaround too, but wasn't sure if it would work.
    Ok I think I have tracked down most of it.

    ChunkProviderGenerateWorldRandom2 _chunkProvider = new ChunkProviderGenerateWorldRandom2(GameManager.Inst ance.World.ChunkCache, GameManager.Instance.World.GetWorldCreationData(), GamePrefs.GetString(EnumGamePrefs.GameWorld));
    _chunkProvider.RequestChunk(_x, _y);
    _chunkProvider.DoGenerateChunks();


    where _x, _y are the chunk co-ords (not world co-ords). But you would probably need to do some delay and repeat checking to see if the chunk has been loaded before you tried to use it.

    I don't have time to fully test it atm so will get back to it in the next day or two.

  9. #54
    Refugee icedsun's Avatar
    Join Date
    Dec 2016
    Posts
    25
    Rep Power
    0
    Quote Originally Posted by StompyNZ View Post
    Ok I think I have tracked down most of it.

    ChunkProviderGenerateWorldRandom2 _chunkProvider = new ChunkProviderGenerateWorldRandom2(GameManager.Inst ance.World.ChunkCache, GameManager.Instance.World.GetWorldCreationData(), GamePrefs.GetString(EnumGamePrefs.GameWorld));
    _chunkProvider.RequestChunk(_x, _y);
    _chunkProvider.DoGenerateChunks();


    where _x, _y are the chunk co-ords (not world co-ords). But you would probably need to do some delay and repeat checking to see if the chunk has been loaded before you tried to use it.

    I don't have time to fully test it atm so will get back to it in the next day or two.
    I wasn't able to get this to load any chunks as far as I could tell. Running "mem" on the server still showed 0 chunks loaded, although maybe it loads and then unloads because no players are there.

    A different issue I noticed is that I can spawn entities into the world even though no chunks are loaded, but they just end up falling out of the world because the chunk hasn't loaded.

  10. #55
    Inventor Gareee's Avatar
    Join Date
    Jun 2016
    Posts
    990
    Rep Power
    1
    How you can have that many on screen and not be down to a slideshow is beyond me. We really don't want to turn all the eye candy off the be able to run well... It adds so much atmosphere.

  11. #56
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Houston-ish, Texas
    Posts
    17,396
    Rep Power
    1
    Even on my video the lag was from spawns, not the variance of zombies... That's a tfp thing they just need to fix.

  12. #57
    Inventor Gareee's Avatar
    Join Date
    Jun 2016
    Posts
    990
    Rep Power
    1
    I dunno... On screen, he's down to 15 fps.

  13. #58
    Reconstructionist
    Join Date
    Sep 2016
    Location
    NL - Tilburg
    Posts
    665
    Rep Power
    1
    Quote Originally Posted by StompyNZ View Post
    Ok I think I have tracked down most of it.

    ChunkProviderGenerateWorldRandom2 _chunkProvider = new ChunkProviderGenerateWorldRandom2(GameManager.Inst ance.World.ChunkCache, GameManager.Instance.World.GetWorldCreationData(), GamePrefs.GetString(EnumGamePrefs.GameWorld));
    _chunkProvider.RequestChunk(_x, _y);
    _chunkProvider.DoGenerateChunks();


    where _x, _y are the chunk co-ords (not world co-ords). But you would probably need to do some delay and repeat checking to see if the chunk has been loaded before you tried to use it.

    I don't have time to fully test it atm so will get back to it in the next day or two.
    I looked at the code of pimps AIAirdrop class and they do use ChunkObserver for loading the chunks the crates are going to be landing on. No luck so far but i thouhgt it might help someone

    ChunkManager.ChunkObserver co = GameManager.Instance.AddChunkObserver(cl, true, 3, -1);
    where cl are the unity.vector3 coords (not world coords)

  14. #59
    Colony Founder StompyNZ's Avatar
    Join Date
    Apr 2015
    Posts
    3,778
    Rep Power
    1
    Quote Originally Posted by Prisma501 View Post
    I looked at the code of pimps AIAirdrop class and they do use ChunkObserver for loading the chunks the crates are going to be landing on. No luck so far but i thouhgt it might help someone

    ChunkManager.ChunkObserver co = GameManager.Instance.AddChunkObserver(cl, true, 3, -1);
    where cl are the unity.vector3 coords (not world coords)
    if at least one player is logged in then that will probably work.

    I've got zombies spawning as chunk observers and they stay active from a long distance to the player. I had one aggroed on me, teleported about 500 blocks and it ran all the way to me across unexplored areas

  15. #60
    Colony Founder StompyNZ's Avatar
    Join Date
    Apr 2015
    Posts
    3,778
    Rep Power
    1
    Got the Web App working nicely now. Needs some styling on the html and adding the sort/filter/paging to the tables, but otherwise it works prefectly for the online list.

    Offline list needs some trickery set up for servers with large player directories so it only does the full looking up of data one time, but i have a plan for that. If a player goes online the hub will send a ping to clients to to drop them from the offline list, and if they go offline it will send just their data file to clients to add the the offline list.

    This will give realtime stats for online players as a web page. depending on how busy the server is you could potentially crank up the refesh rate to multiple times a second, but even at 1 second polling its pretty quick.

    The app uses signalR so that only the hub polls the server for data updates (and only the hub needs the admin token, so no end user can see the login details), and any clients viewing the page recieve the data from the hub server when there is data to update on the client. knockout.js is super fast at presenting large data changes and even with 2600 (or even 10000) players in a list it wont have even the slightest delay once I add the paging.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •