Post by raithwall on May 6, 2008 5:26:12 GMT -5
This thread is a compilation of the memory efficient way to do things. You could free up insane amounts of memory by using them!
General Rules of memory efficient design:
Rule 1: always sort database numbers
Rule 2: Use "Target" instead of specific whenever possible.
Rule 3: Use sort instead of condition where possible
Rule 4: Use direct variable calculations instead of Sort.
Rule 5: Use as few events as possible.
Rule 6: Use script conditions instead of event pages.
Rule 7: Use Teleport and Escape auto coordinates for towns
Rule 8: Sort a single Warp script by X, Y, Z coordinates.
Rule 9: Sort general warp events by world number.
Rule 10: Use a single Enter Map script, sorting world number.
Direct Effects: Make 3 directing events: weapons, abilities, enemy. Sort ability number, direct effect, or weapon property. Check Hp/Mp, Consume Hp/MP, make them into one script by checking ability type, magic or skill. Don't make a direct effect for every spell, make about 5 or 6 single target, and 5 or 6 multi target with different rates. A few healing, a few status.
Visual Effects: Dysect your visual effects into many 1 element effects. You can always combine them together in a directing script. When several effects have a red firework, you can delete them as you only need 1 red firework. This also increases the variety of possible screen effects you can make. leave enemy effects alone.
Enemy Level Up: You can have enemies get stronger as you level, thus reusing them, and limit them from time to time with a max monster level variable. Use the enemies battle variables as stats and set them in a custom indirect effect that multiplies them based on the players levels. Then set up a repeat branch after battle to repeatedly give xp and money up until level.
Villagers: You only need about 10 villager events that are reused in every single town. Setup a random model script, and a random conversation script. Put the party in a step script that increases and resets a variable. Have this variable determine the number of times the random model script is repeated. This is necessary because the game will choose the exact same random calculations every time.
Rumors and Text Strings: use item and ability descriptions that the player really doesn't need, such as enemy ability, generic items, etc.
Treasure: You only need about 10 different chest events, depending on how many chests you want to have at once in a single room. Sort the world number, and room number, and make a flag for each treasure. Now set the item variable to the item you want to give. You can give many random treasures with a single variable command...... At the end of the script make a merchant list with a bogus item called take treasure. Save the item number with a temp variable, then make the item number = the temp variable after the display buy list in a new merchant script. This will cause the buy item action to buy whatever item was setup with item variable. Make sure the buy list is set to 0 buy price and 0 sell price. Also use the who list so the player can decide where to put the item. You also need a repeat branch if the player tries to up the quantity and one if they try to cancel the list.
Dungeon Editor: Try not to use the dungeon editor for much. Make a room called blank dungeon, and customize it with object placement. There is a limit to how many buildings can be placed in object and event placement though, so use this editor for floor plans and big dungeons that need the extra help.
Building Editor: make walls and all sorts of blocks here and build your dungeons with object placement instead of the dungeon editor. This way you don't keep paying for the same blocks over and over again. Buildings can also be events, and removed with scripts making the same dungeon even more reusable.
3D Buildings: Please, when you build 3d walls make their back sides transparent. This way you can use low camera and the camera will see through any wall obstructing it. The is mainly useful for indoor settings. Some of the best games in the genre have yet to figure this out, as a result you are constantly changing the camera.
Traits: Try not to use them. Random behavior is more efficient. A few special uses such as bosses or npcs is fine, but you generally want to avoid making this into a big database. I mean your just paying heaps of memory to do something the game can do for free.
Unit Placement: Only make 1 or 2 unit placements. 1 For World, and another for Dungeon. When you need a dungeon to have a very specific set of enemies, have the enter battle teleport you to where your standing, and make your own random battle script with event battles upon entering the map. You will need several flags, but this method is far more efficient then placing battle events on every other square. Random battles won't trigger from a characters per step indirect effect script, so don't waste your time trying it.
Shave your Scripts: Delete scripts you don't need, remove the notes from preset scripts, shave off some of the error messages that only get in the way, such as xxxx gave item to zzzz.
Sound: Use map music and battle music instead of setting each song in the enter world script.
Unique Enemy Ability: Use the enemy battle input as a name for a unique ability. This ability (called battle input) should be a normal attack which sometimes applies a random status. Its the same ability but each enemy can have a different name for it.
Enemy Actions: Try to avoid having too many of these. Make more of these when you absolutely must have a different color scheme of enemy. Otherwise just make more enemies that reuse them. You should only be using 1 per each type of enemy in the game.
Classes: If you want exclusive classes work with party members normal variables. Make 3 or 4 different class trainers and sort your classes with battle classes (offensive skills) support classes, magic classes, etc. So that each member can have one of each type. Then repeat the change class script until the chosen class number = that characters normal variable. There are other ways of doing this efficiently. Whatever you do, dont make bogus classes to serve as class paths for exclusive classes. Classes are memory intensive and bogus classes are unprofessional and clutter up the status screen.
Images: Don't use them... just don't. They take up insane amounts of memory. If you really must have one, then have only one.
Scripts: make call scripts for things you do frequency in many other scripts, such as random variables, names, etc. That way you can use them as much as you need without paying memory every time.
General Rules of memory efficient design:
Rule 1: always sort database numbers
Rule 2: Use "Target" instead of specific whenever possible.
Rule 3: Use sort instead of condition where possible
Rule 4: Use direct variable calculations instead of Sort.
Rule 5: Use as few events as possible.
Rule 6: Use script conditions instead of event pages.
Rule 7: Use Teleport and Escape auto coordinates for towns
Rule 8: Sort a single Warp script by X, Y, Z coordinates.
Rule 9: Sort general warp events by world number.
Rule 10: Use a single Enter Map script, sorting world number.
Direct Effects: Make 3 directing events: weapons, abilities, enemy. Sort ability number, direct effect, or weapon property. Check Hp/Mp, Consume Hp/MP, make them into one script by checking ability type, magic or skill. Don't make a direct effect for every spell, make about 5 or 6 single target, and 5 or 6 multi target with different rates. A few healing, a few status.
Visual Effects: Dysect your visual effects into many 1 element effects. You can always combine them together in a directing script. When several effects have a red firework, you can delete them as you only need 1 red firework. This also increases the variety of possible screen effects you can make. leave enemy effects alone.
Enemy Level Up: You can have enemies get stronger as you level, thus reusing them, and limit them from time to time with a max monster level variable. Use the enemies battle variables as stats and set them in a custom indirect effect that multiplies them based on the players levels. Then set up a repeat branch after battle to repeatedly give xp and money up until level.
Villagers: You only need about 10 villager events that are reused in every single town. Setup a random model script, and a random conversation script. Put the party in a step script that increases and resets a variable. Have this variable determine the number of times the random model script is repeated. This is necessary because the game will choose the exact same random calculations every time.
Rumors and Text Strings: use item and ability descriptions that the player really doesn't need, such as enemy ability, generic items, etc.
Treasure: You only need about 10 different chest events, depending on how many chests you want to have at once in a single room. Sort the world number, and room number, and make a flag for each treasure. Now set the item variable to the item you want to give. You can give many random treasures with a single variable command...... At the end of the script make a merchant list with a bogus item called take treasure. Save the item number with a temp variable, then make the item number = the temp variable after the display buy list in a new merchant script. This will cause the buy item action to buy whatever item was setup with item variable. Make sure the buy list is set to 0 buy price and 0 sell price. Also use the who list so the player can decide where to put the item. You also need a repeat branch if the player tries to up the quantity and one if they try to cancel the list.
Dungeon Editor: Try not to use the dungeon editor for much. Make a room called blank dungeon, and customize it with object placement. There is a limit to how many buildings can be placed in object and event placement though, so use this editor for floor plans and big dungeons that need the extra help.
Building Editor: make walls and all sorts of blocks here and build your dungeons with object placement instead of the dungeon editor. This way you don't keep paying for the same blocks over and over again. Buildings can also be events, and removed with scripts making the same dungeon even more reusable.
3D Buildings: Please, when you build 3d walls make their back sides transparent. This way you can use low camera and the camera will see through any wall obstructing it. The is mainly useful for indoor settings. Some of the best games in the genre have yet to figure this out, as a result you are constantly changing the camera.
Traits: Try not to use them. Random behavior is more efficient. A few special uses such as bosses or npcs is fine, but you generally want to avoid making this into a big database. I mean your just paying heaps of memory to do something the game can do for free.
Unit Placement: Only make 1 or 2 unit placements. 1 For World, and another for Dungeon. When you need a dungeon to have a very specific set of enemies, have the enter battle teleport you to where your standing, and make your own random battle script with event battles upon entering the map. You will need several flags, but this method is far more efficient then placing battle events on every other square. Random battles won't trigger from a characters per step indirect effect script, so don't waste your time trying it.
Shave your Scripts: Delete scripts you don't need, remove the notes from preset scripts, shave off some of the error messages that only get in the way, such as xxxx gave item to zzzz.
Sound: Use map music and battle music instead of setting each song in the enter world script.
Unique Enemy Ability: Use the enemy battle input as a name for a unique ability. This ability (called battle input) should be a normal attack which sometimes applies a random status. Its the same ability but each enemy can have a different name for it.
Enemy Actions: Try to avoid having too many of these. Make more of these when you absolutely must have a different color scheme of enemy. Otherwise just make more enemies that reuse them. You should only be using 1 per each type of enemy in the game.
Classes: If you want exclusive classes work with party members normal variables. Make 3 or 4 different class trainers and sort your classes with battle classes (offensive skills) support classes, magic classes, etc. So that each member can have one of each type. Then repeat the change class script until the chosen class number = that characters normal variable. There are other ways of doing this efficiently. Whatever you do, dont make bogus classes to serve as class paths for exclusive classes. Classes are memory intensive and bogus classes are unprofessional and clutter up the status screen.
Images: Don't use them... just don't. They take up insane amounts of memory. If you really must have one, then have only one.
Scripts: make call scripts for things you do frequency in many other scripts, such as random variables, names, etc. That way you can use them as much as you need without paying memory every time.