Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve order of event updates #753
The most important bit is in Game_Map::Update. The process in which all the events are updated is now more convoluted, but also more accurate to the output of the event tracer plugin. To make the code more digestible, I've changed the container of the events and common events from std::map<int, EASYRPG_SHARED_PTR<Game_(Common)Event>> to std::vector<Game_(Common)Event>. This means a linear search, but we don't ever search common events and there are few maps with more than a thousand events.
Some facts about the game logic update thanks to the event tracer.
From (2), (3) and (4), I've concluded that the hero has to be updated before the non-parallel events, but it must be aware if there's any auto-starting or collision-triggered event because of (5). That's what the workaround function Game_Map::IsAnyEventStarting is for.
This also fixes #677
Well done. For analyzing when move routes are updated doing asm patches via dynrpg was really worth it.
Very cool and crazy (wtf did Enterbrain think when inventing this) at the same time.
referenced this pull request
Feb 8, 2016
It's the actual behaviour of autostarting common event, they loop and run multiple times in each frame while their conditions are met. In RPG_RT, the number of loops depends on how many event commands it has. The more event commands it has, the less it loops. I think 500 loops is good enough.