DEVELOPMENT POLL: Names or Indices?

Chat and ask questions about the RPG Maker Mode here.

Should we deprecated indices in favour of strings/ids for indexing RPG definitions?

Poll ended at February 16th, 2013, 1:05 am

No! Don't break compatibility (Again!)
3
43%
Yes! Do it, it's for the best.
4
57%
 
Total votes: 7

Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

DEVELOPMENT POLL: Names or Indices?

Postby Hirato » February 9th, 2013, 1:05 am

I got this slightly whiny email from kddekadenz yesterday.

Why did you choose to make it necessary to number the scripts?
This is a big stopper if you want to make changes to your game.
Also, modding is impossible using this method: a user-made modification would be incompatible with other mods and future versions of the main game.
All of the scripts in the defined sub-folders should be able to executed.
Here is an example of what I mean: /newent item apple instead of /newent item 1. (the name of the script is apple.cfg)
This makes things more visible and organized.


I've actually been pondering doing that, and I've warmed up a lot to strings over the past year.
So I figure I'll do it as a poll, you have a week to decide how it will go.


If we were to switch to a named system, and cache things internally via hashtables instead of vectors, the following would happen

Pros
  • Ease of Use
  • Modding made Easy
  • Ease of Use
  • Structure is more maintainable/extensible
  • Ease of Use
  • Less strict conformance checks.
  • Ease of Use

Cons
  • Backwards compatibility will be completely and irreparably broken; you will need to PLACE ALL OF YOUR ENTITY SPAWNS AGAIN
  • Increased Memory Usage (minimal)
  • Decreased Performance (minimal)
  • Less strict conformance checks!!

Make your choice.
This is not a url, clicking it is pointless

User avatar
kddekadenz
Member
Member
Posts: 423
Joined: July 17th, 2011, 11:02 am
Name: kdd
Contact:

Re: DEVELOPMENT POLL: Names or Indices?

Postby kddekadenz » February 9th, 2013, 2:46 pm

Hm, my mail doesn't meant to be whiny.

Could you explain the reasons of the negative sides?
I have no plan of the inside of the engine, to be honest.

Why shouldn't it be backwards compatible? Numbers can be loaded as strings, too, can't they?

Also, I don't think the decrease in performance would be big.
Kelgar is an advanced RPG beeing developed in Sandbox

Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: DEVELOPMENT POLL: Names or Indices?

Postby Hirato » February 9th, 2013, 9:42 pm

Performance will have a rather minimal effect, searching for strings rather than accessing a number directly is just more costly.
And memory usage will increase by 64 bytes for each entity on the map (for 10K entities, that's ~600 KB), and also a bit for all the entities themselves as they'd now reference the scripts by names. It's relatively minor and can be ignored for modern systems.

But backwards compatibility, there's no information available in the map, so we cannot even import the second attribute and write it to the name string.
The only thing the map stores is the map's version and format, with no details available about the game itself (except for identifying which game it is).
Last edited by Hirato on February 17th, 2013, 10:03 am, edited 1 time in total.
Reason: 10000 * 64 != 6400000
This is not a url, clicking it is pointless

java.x.beast
Member
Member
Posts: 194
Joined: August 10th, 2011, 2:35 pm
Name: Addis
IRC Username: javaxbeast
Location: Chicago, IL
Contact:

Re: DEVELOPMENT POLL: Names or Indices?

Postby java.x.beast » February 9th, 2013, 11:43 pm

A wild java.x.beast appears! I have returned to my beloved forum! Anyways, here's my two cents on the subject.

I have to agree with Hirato on this one. While it may be easier to use strings for names, indices would be far better because of memory. In the time I've been gone, I've studied a lot about computers and programming and how the two are interlocked. I've experimented with different programming languages and different software for making games and have come upon the conclusion that performance and memory is a HUGE part of a game/software. If your game is small and takes up 500MB of RAM, you're obviously doing something wrong. Optimization is key to a good game.

I remember RPG Mode back when it was still in the developmental stage(early,early developmental stage), and it used strings for storing entities. I loved this and thought that it was cool and was quite disappointed when it was changed to indices. However, I now understand that this was a great choice because after checking the RAM, I was using 1MB less than I previously was. You might not think this to be big, but trust me, it will count in the future when you make a larger game.

Smart choice, Hirato. ;)

-Zaddis

P.S. : What version of PAS are we on right now?
Age of Darkness

Maps: Image
Music: Image
Models: Image
Scripts: Image
Other: Image


Visit the company website: (In progress (Expected to be released in two weeks :uber:) 8-) :D 8-) )
Visit the company page on ModDB: Vulcanis Entertainment


java.x.beast wrote: I got them moves like JAGger!!!

User avatar
kddekadenz
Member
Member
Posts: 423
Joined: July 17th, 2011, 11:02 am
Name: kdd
Contact:

Re: DEVELOPMENT POLL: Names or Indices?

Postby kddekadenz » February 10th, 2013, 9:17 am

Hehe, ask a coder what's most important and he will say performance.
What do you want with an engine which lacks features, but has therefore a maximized performance?
The decrease in performance is minimal, but the increase in visibilty and modabilty is big.

For me it currently is fine that there is no backward-compatibility. Kelgar is being remade, so it's the perfect time.
For other it may suck. I don't know of any other big projects, though.
Kelgar is an advanced RPG beeing developed in Sandbox

java.x.beast
Member
Member
Posts: 194
Joined: August 10th, 2011, 2:35 pm
Name: Addis
IRC Username: javaxbeast
Location: Chicago, IL
Contact:

Re: DEVELOPMENT POLL: Names or Indices?

Postby java.x.beast » February 11th, 2013, 6:36 am

First off, you're right. A programmer will tell you performance is very important.

Secondly, what features will be missing? From what I understand, I'm assuming you mean modability. Since the general population of PAS users will not be looking to make moddable games, I think it's safe to go towards the interest of the majority. You could easily edit the source code to utilize strings instead of indices, if modability is that important to your game.

Third, backwards-compatibility is very important whether it's a tiny or huge project. No user will want to be stuck between choosing to completely restart their project or miss out on new features.

Finally, performance isn't the issue here, it's the memory. Performance isn't affected that much. Memory, as Hirato said, will increase by 64 bytes per entity. As aforementioned, this will discourage users from playing your game because it could very well take up a giant part of their RAM (or wherever Hirato's saving it to).

-Zaddis
Age of Darkness

Maps: Image
Music: Image
Models: Image
Scripts: Image
Other: Image


Visit the company website: (In progress (Expected to be released in two weeks :uber:) 8-) :D 8-) )
Visit the company page on ModDB: Vulcanis Entertainment


java.x.beast wrote: I got them moves like JAGger!!!

User avatar
kddekadenz
Member
Member
Posts: 423
Joined: July 17th, 2011, 11:02 am
Name: kdd
Contact:

Re: DEVELOPMENT POLL: Names or Indices?

Postby kddekadenz » February 11th, 2013, 11:35 am

I think the easy modabilty is the strength of the original Sauerbraten Engine and the reason why it is still popular.
For RPG mode the modding support needs to be extended, yes.

Also for me as scripter it totally sucks. Recently Hirato pushed a change on github for Kelgar, removing some triggers.
The former trigger scripts needed to be deleted, but that was not possible (because the need of numbering scripts), so their content was deleted. In the past I experienced, that empty scripts can eat a lot of performance using PAS.
java.x.beast wrote:No user will want to be stuck between choosing to completely restart their project or miss out on new features.

That currently is the case when removing old features. Either have few FPS, or change the order of the related scripts (e.g. triggers). This results in the need of extensive replacing of entities.

So I mean not only modabilty for the player, but also for me as developer.
Kelgar is an advanced RPG beeing developed in Sandbox

Hirato
Developer
Developer
Posts: 689
Joined: May 30th, 2009, 1:23 pm
IRC Username: hirato

Re: DEVELOPMENT POLL: Names or Indices?

Postby Hirato » February 11th, 2013, 7:54 pm

kddekadenz wrote:Also for me as scripter it totally sucks. Recently Hirato pushed a change on github for Kelgar, removing some triggers.
The former trigger scripts needed to be deleted, but that was not possible (because the need of numbering scripts), so their content was deleted. In the past I experienced, that empty scripts can eat a lot of performance using PAS.
java.x.beast wrote:No user will want to be stuck between choosing to completely restart their project or miss out on new features.

That currently is the case when removing old features. Either have few FPS, or change the order of the related scripts (e.g. triggers). This results in the need of extensive replacing of entities.


Nope.
The performance issue is completely unrelated, that was 100% with you; you and the rest of the kelgar team tried to make models invisible by using models that didn't exist, this meant it tried to load the model every time it was drawn, and then failed, causing a massive hit to performance.
I have since tweaked the code to make it annoy the *heck* out of you it you ever try to do that again :P

The empty scripts are just that, empty, they have no impact on performance at all.
The triggers also won't cause any issues provided they remain unused.
Think of them as reserved slots, if you need/want to add a new script/trigger, just grab one of them and use them for the new script/trigger.


java.x.beast wrote:No user will want to be stuck between choosing to completely restart their project or miss out on new features.

The HUGE backwards compatibility issue is the reason I made the poll.
Even now the RPG is still an alpha, though we're definitely crawling closer to beta status, so I haven't really cared much to keep things compatible.
This is not a url, clicking it is pointless

java.x.beast
Member
Member
Posts: 194
Joined: August 10th, 2011, 2:35 pm
Name: Addis
IRC Username: javaxbeast
Location: Chicago, IL
Contact:

Re: DEVELOPMENT POLL: Names or Indices?

Postby java.x.beast » February 11th, 2013, 8:38 pm

kddekadenz wrote:I think the easy modabilty is the strength of the original Sauerbraten Engine and the reason why it is still popular.
For RPG mode the modding support needs to be extended, yes.

Also for me as scripter it totally sucks.


This, my friend, can be solved by adding in the mod support yourself with some C++ knowledge. Dig into the engine and do tweaks and changes here and there, and you can achieve it yourself. Learning to program C++ will also help you in the future, so this is a win-win.

I don't think that just because your game needs mod support, we should completely change the way PAS works. As aforementioned, the general population will not need mod support but will need to save memory usage, which indices can help solve.

I'll leave you with a quote from a great friend of mine.
Zekka wrote:Being a programmer is not about knowing code and having everything easy for you to use. It is about using your knowledge of code to overcome obstacles and solve complex problems.


-Zaddis
Age of Darkness

Maps: Image
Music: Image
Models: Image
Scripts: Image
Other: Image


Visit the company website: (In progress (Expected to be released in two weeks :uber:) 8-) :D 8-) )
Visit the company page on ModDB: Vulcanis Entertainment


java.x.beast wrote: I got them moves like JAGger!!!

User avatar
kddekadenz
Member
Member
Posts: 423
Joined: July 17th, 2011, 11:02 am
Name: kdd
Contact:

Re: DEVELOPMENT POLL: Names or Indices?

Postby kddekadenz » February 12th, 2013, 1:51 am

Hirato wrote:Nope.
The performance issue is completely unrelated, that was 100% with you; you and the rest of the kelgar team tried to make models invisible by using models that didn't exist, this meant it tried to load the model every time it was drawn, and then failed, causing a massive hit to performance.
I have since tweaked the code to make it annoy the *heck* out of you it you ever try to do that again :P

Aha, ok.

java.x.beast wrote:This, my friend, can be solved by adding in the mod support yourself with some C++ knowledge. Dig into the engine and do tweaks and changes here and there, and you can achieve it yourself. Learning to program C++ will also help you in the future, so this is a win-win.

I want to be able to access all future versions of the engine.
Sure, learning C++ would help me, but I currently don't have the time.

java.x.beast wrote:I don't think that just because your game needs mod support, we should completely change the way PAS works. As aforementioned, the general population will not need mod support but will need to save memory usage, which indices can help solve.

Who are you talking about? Only you,me and Hirato participated in the discussion. Currently most people voted for strings, so that's what the general population may need.

Zekka wrote:Being a programmer is not about knowing code and having everything easy for you to use. It is about using your knowledge of code to overcome obstacles and solve complex problems.

Yes, but being for example a mapper, you don't want to run in problems. PAS is easy to use (even though it lacks documentation) and it needs to stay easy to use.

EDIT: Also, the poll question may be hard to understand for "normal" users.
Kelgar is an advanced RPG beeing developed in Sandbox


Return to “RPG Maker Mode”

Who is online

Users browsing this forum: No registered users and 2 guests