Simplifying Map Creation

Avatar

By dulsi 30 Aug 2016 10:59

Member · 27 comments

I was thinking of map creation and handling multi player. Iterating through all the scripts that initialize a map but don't run again is a waste. Instead of simply having "event" types on the map, I'd like to add "init" type. This would only be run once when the map loads.

You should probably have a lot of things you can interact with. It annoying to map creator to have to specify the same two conditions on the event. In the multi player setup these will need to be checked for each player. If a player is not pressing enter, we know we could skip checking all of those. How about an "interact" type instead of "event". If it is "interact", we keep them in a separate list which is only checked when a player presses enter.

Avatar

By RalmonM 30 Aug 2016 11:21

Member · 13 comments

This seems to be a great idea for optimizing the game. Developers, what do you think?

Avatar

By ShadowApex 1 Sep 2016 18:56

Lead Developer · 374 comments
dulsi wrote

I was thinking of map creation and handling multi player. Iterating through all the scripts that initialize a map but don't run again is a waste. Instead of simply having "event" types on the map, I'd like to add "init" type. This would only be run once when the map loads.

You should probably have a lot of things you can interact with. It annoying to map creator to have to specify the same two conditions on the event. In the multi player setup these will need to be checked for each player. If a player is not pressing enter, we know we could skip checking all of those. How about an "interact" type instead of "event". If it is "interact", we keep them in a separate list which is only checked when a player presses enter.

I think having an "init" type is a great idea. I also like the idea of having an "interact" type to lower the number of condition checks each frame. As long as both of these types are documented well and available for map creators, I wouldn't be opposed to adding these event types.


Avatar

By dulsi 2 Sep 2016 02:01

Member · 27 comments
ShadowApex wrote

I think having an "init" type is a great idea. I also like the idea of having an "interact" type to lower the number of condition checks each frame. As long as both of these types are documented well and available for map creators, I wouldn't be opposed to adding these event types.

About documenting this and the previous actions I worked on, should I put the documentation on the wiki now or wait until a release with the new feature.

Avatar

By bitcraft 2 Sep 2016 02:53

Champion · 167 comments

There was some talk earlier about "init" actions.  It would be a great feature.  I've added a github issue to track progress on it.

https://github.com/Tuxemon/Tuxemon/issues/251

Avatar

By dulsi 15 Oct 2016 03:43

Member · 27 comments

I have init implemented in my repository now. I converted "Play Music" on two maps to init scripts.

Avatar

By dulsi 30 Mar 2017 01:38

Member · 27 comments
dulsi wrote

About documenting this and the previous actions I worked on, should I put the documentation on the wiki now or wait until a release with the new feature.

I've started updating the wiki for the new actions I added like dialog_choice. I'll do the different event types next.

EDIT: Documentation for init and interact event types added.

Last edited by dulsi (30 Mar 2017 12:56)

Avatar

By bitcraft 30 Mar 2017 19:12

Champion · 167 comments

Sounds great dulsi.  I wonder if this fixes the issue where sound doesn't play after battle?  You may want to also dig around in the tuxemon source, as there are a few instances of the music being hardcoded (as I remember).

Also, the map preload feature that was implemented...  Will your init events be triggered when a map is preloaded?  OR will it trigger when the map is actually used?

https://github.com/Tuxemon/Tuxemon/issues/267

Avatar

By dulsi 30 Mar 2017 19:30

Member · 27 comments

My first guess is that my change caused the music to not be played after battle. These changes went in a while ago but I only just got around to documenting them. I believe init events will trigger when a map is used not preloaded.

I've been busy playing with Legos mostly so I haven't done much with tuxemon recently.

Avatar

By bitcraft 30 Mar 2017 21:53

Champion · 167 comments

I think many of us have taken a break from the project.  It was dominating my time before I took a break.  I'm still catching up now as I prepare to do some more work....  Have your changes been merged in yet?  If not, feel free to open a PR and we can merge what you have so far, if you don't feel like doing documentation or clearing up the hard references to music.

Last edited by bitcraft (30 Mar 2017 22:17)

Avatar

By dulsi 31 Mar 2017 02:33

Member · 27 comments

All my changes had been merged. I wanted to wait for that before updating the documentation.

Fix for the music issue has been created. Pull request created.