Skip to main content

User login

What is OpenID?
  • Log in using OpenID
  • Cancel OpenID login
  • Create new account
  • Request new password
Register
  • Home
  • Browse
    • 2D Art
    • 3D Art
    • Concept Art
    • Textures
    • Music
    • Sound Effects
    • Documents
    • Featured Tutorials
  • Submit Art
  • Collect
    • My Collections
    • Art Collections
  • Forums
  • FAQ
  • Leaderboards
    • All Time
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
    • Weekly
      • Total Points
      • Comments
      • Favorites (All)
      • Favorites (2D)
      • Favorites (3D)
      • Favorites (Concept Art)
      • Favorites (Music)
      • Favorites (Sound)
      • Favorites (Textures)
  • ❤ Donate
FLARE

multiplayer entity troubleshooting

nazgul
Saturday, January 7, 2023 - 09:11

Hey coders,

At the EntityManager::handleNewMap function it looks like this is where the entities for get loaded and tracked for later rendering onscreen. The issue I ran into was if I introduced this code snip for (multiplayer mode),the program seg faults:

 for(int y = 0; y < eset->misc.net_pc_count; y++){

Entity *nete;
    nete->stats.pos = pc->stats.net_pc[y].pos;
    nete->stats.direction = pc->stats.net_pc[y].dir;
    entities.push_back(nete);

}

-----gdb bt----------

Entity::getRenderBounds (this=0x55555c5c5da0, cam=...) at /game/src/Entity.cpp:578
578       unsigned index = stats.layer_def[ff][i];
(gdb) bt
#0  0x00005555555d0b8c in Entity::getRenderBounds (
    this=0x55555c5c5da0, cam=...)
    at /throne/pro/stealthcavern/src/Entity.cpp:578
#1  0x00005555555e0507 in EntityManager::entityFocus (
    this=0x55555bc707b0, mouse=..., cam=..., alive_only=true)
    at /game/src/EntityManager.cpp:300
#2  0x000055555560f93d in GameStatePlay::checkEnemyFocus (
    this=0x555558ab6770)
    at /game/src/GameStatePlay.cpp:185
#3  0x0000555555612399 in GameStatePlay::logic (
    this=0x555558ab6770)
    at /game/src/GameStatePlay.cpp:625
#4  0x000055555562265f in GameSwitcher::logic (this=0x5555559d3c40)
    at /game/src/GameSwitcher.cpp:161
--------end bt---------

It looks like entityFocus is trying to determine the renderbounds,but the variable is going out of bound? I have reached brick wall on this logic. if anyone is able to overcome please elaborate.

  • Log in or register to post comments
PeterX
joined 2 years 3 months ago
Saturday, January 7, 2023 - 11:31

As far as I know this is not a coding forum. (But maybe a coder is around to help you.') I would recommend using

https://freegamedev.net

instead.

  • Log in or register to post comments
MedicineStorm
joined 10 years 5 months ago
Sunday, January 8, 2023 - 07:07
MedicineStorm's picture

This is the correct forum: the question is in regards to the FLARE engine's behavior to a custom script.

--Medicine Storm

 

  • Log in or register to post comments
nazgul
joined 4 weeks 1 day ago
Thursday, January 12, 2023 - 04:25

Breakthrough..I got it working with the following snip:

for(int y = 0; y < eset->misc.net_pc_count; y++){

Entity *nete = new Entity();

    nete->stats.animations = "animations/enemies/training_dummy.txt";
    nete->loadAnimations();
    nete->stats.pos = pc->stats.net_pc[y].pos;
    nete->stats.direction = pc->stats.net_pc[y].dir;
    entities.push_back(nete);

}

  • Log in or register to post comments