Pikmin fangame engine/Quick creator guides

From Pikmin Fanon
Jump to: navigation, search

This page contains quick guides that teach you the basics on how to create content for the Pikmin fangame engine. Read this for a list of more in-depth and complete guides.

Areas[edit]

Concepts[edit]

An area's physical geometry is made up of polygons, which represent floors when seen from above. Their height can also be changed, and a polygon with a higher height than its neighbor creates a wall.

How to make an area[edit]

Making a ramp with the area editor.

Feel free to check or copy the existing areas for references and ideas.

  1. Open the game, enter the area editor.
  2. Use the big button on the right to create your area.
  3. Use the "Info" mode to give it a name.
  4. Use the "Layout" mode to create and edit the polygons (also called sectors).
    • Drag a polygon's vertexes around to give it shape.
    • Double click a polygon's lines to create a new vertex.
    • Use the "+" button on the panel to start drawing a new sector.
    • Drag a vertex into another to merge the two. Connect edges to stitch them.
    • Edges between higher sectors to lower ones make walls.
  5. Use the "Objects" mode to create and edit the level's objects.
  6. Use the "Paths" mode to create and edit the Pikmin's paths, by drawing the path stops and links between them.
  7. Use the "Details" mode to create and edit tree shadows.

Further info[edit]

  • On the area editor, right-click-drag moves the camera.
  • Objects will walk up floors within 50 units of each other. Use this for ramps and staircases.
  • Bridges and gates need to be inside sectors of the type "Bridge" or "Blocking", respectively.
  • Don't overlap lines or create non-simple polygons.

Full area guide: Creating areas

Object types[edit]

Concepts[edit]

Red Pikmin is a type of Pikmin, Wollywog is a type of enemy, Captain Olimar is a type of leader, and white bramble gate is a type of gate. You then place on an area several instances of Wollywog, several instances of white bramble gate, (hopefully) one instance of Captain Olimar, etc. Each type has its own properties (color, health, script, etc.)

How to create an object type[edit]

Feel free to check or copy the existing object types for references and ideas.

  1. Create a folder for your object's type in Game_data/Types/<category>.
  2. Inside, create Data.txt.
  3. Inside, write the necessary parameters, which take on the format parameter = value, one per line.
    • name, height, max_carriers, max_health, move_speed, pushable, pushes, radius, rotation_speed, weight.
  4. Depending on the category, you must also add:
    • Pikmin: icon_leaf, icon_bud, icon_flower, top_leaf, top_bud, top_flower. Optionally, but recommended: attack_power, onion_starting_number, throw_strength_mult (a multiplier), carry_strength, has_onion.
    • Leader: icon. Optionally, but recommended: dismiss_sfx, name_call_sfx, throw_strength_mult (a multiplier), whistle_sfx.
    • Enemy: drops_corpse, pikmin_seeds.
    • Onion: pikmin_type.
    • Pellet: match_seeds, non_match_seeds, number, number_image, pikmin_type.
    • Ship: can_heal (healing is done by pressing the throw button near the ship).
    • Bridge: main_texture, rail_texture.
  5. Create and set up the animations for it.

Further info[edit]

  • To make enemies, you also need to create their script.
  • The "Custom" category is for fully custom objects. These too need a script.

Full object type guide: Creating object types

Animations[edit]

Concepts[edit]

Animations are made up of frames that are displayed in rapid succession. Each frame has a sprite, and info about how long it lasts. The engine reads sprites from sections of one or more images. Besides the image, each sprite has hitboxes, which are connected to body parts (e.g. body, head, tail, etc.), and define whether that body part is currently damageable, causing damage, or being ignored. These hit"boxes" are actually circles.

How to create animations[edit]

Feel free to check or copy existing animations and images for references and ideas.

  1. Create the images that will be used for the object's sprites. In every sprite's image, the object must be facing the right.
  2. Create an empty text file called "Animations.txt" in Game_data/Types/<category>/<object>.
  3. Open the game, enter the animation editor.
  4. Use the big button on the right to open the Animations.txt file.
  5. Use the "Edit body parts" mode to create and edit the list of relevant body parts.
  6. Use the "Edit sprites" mode to create and edit the sprites to be used in future animations's frames.
    • Use the big button at the top to select a sprite or create a new one.
    • Use the "Edit hitboxes" button to specify where each body part's hitbox is and what it does. They can be dragged around and resized with the left mouse button.
  7. Use the "Edit animations" mode to create and edit the animations.
    • Use the big button at the top to select an animation or create a new one.
  8. Create the necessary animations for the type of object:
    • Pikmin: idling, thrown, attacking, grabbing, sprout, plucking, lying, carrying, sighing.
    • Leader: idling, walking, plucking, getting_up, dismissing, throwing, whistling, lying (lying down with the Napsack and staying there), pain, knocked_down (includes staying on the ground and getting up), spraying.
    • Gate or bridge: idling, destroyed.

Further info[edit]

  • On the animation editor, right-click-drag moves the camera.
  • When making animations for Pikmin, use the "Edit Pikmin top" button on an animation's data to specify where the leaf/bud/flower is on that frame.
  • Pikmin and leaders don't use hitboxes.
  • Pikmin should have some signal on the sprite where their attack connects, so the engine can know when to inflict damage.

Full animation guide: Creating animations

Scripts[edit]

Concepts[edit]

Scripts use an event-driven finite-state machine. An object is always in one of several states (e.g. sleeping, going home, biting). In this state, it can respond to a series of events (e.g. when it sees a Pikmin, when it reaches its home, when it loses health). Its response consists of a list of actions (e.g. changing animation, changing state, swallowing Pikmin in its mouth, walk somewhere). Only enemies use the scripting feature.

How to create a script[edit]

Feel free to check or copy existing scripts for references and ideas. It is recommended to create the object you want before writing the script.

  1. Go to Game_data/Types/<category>/<type>.
  2. Inside, create a file called Script.txt.
  3. Inside, add a script block. This means one line has script {, and another has }.
  4. Inside the script block, create a block for the name of a state.
  5. Inside a state's block, create a block for an event. It can be any of the following:
    • on_enter (when the state is entered), on_leave (when the state is left), on_animation end, on_big_damage, on_bottomless_pit, on_damage, on_death, on_face_object, on_far_from_home, on_focus_off_reach, on_mouth_empty, on_mouth_occupied, on_object_in_reach, on_opponent_in_reach, on_pikmin_land, on_pikmin_latch, on_pikmin_touch, on_reach_destination, on_touch_hazard, on_touch_opponent, on_touch_spray, on_timer (when its timer ticks).
  6. Inside an event's block, write one action per line, in the format action = parameters. It can be any of the following:
    • animation, chomp (max Pikmin deaths + hitboxes to use for chomping, if any), eat (number of Pikmin to eat, or "all", if any), far_reach, focus, gravity, health (you can add "relative" before the number), hide, if (a variable is worth the provided value), if_less, if_more, if_not, inc_var (increment variable), move ("focused_mob", "home", "stop"), near_reach particle, special_function ("die_start", "die_end", "delete"), state, timer (starts the timer with the specified period), var (sets a variable to a value).
  7. In the same file, add the first_state parameter, which specifies what the starting state is.
  8. In Data.txt in the same folder, next to the existing object parameters, add the following parameters:
    • big_damage_interval, territory_radius.
    • reaches, which is a block with named "reaches". Each reach uses the format <pie-slice 1 radius> <pie-slice 1 angle> <pie-slice 2 radius> <pie-slice 2 angle> (the latter two are optional).
  • Remember to place events for dying, falling into bottomless pits, and being sprayed in all or most states.

Further info[edit]

  • To chase after an object, it must first be focused on.
  • For an enemy to eat, it must first set how many Pikmin can be grabbed at max, and which hitboxes will do the grabbing. After some Pikmin are grabbed, it must then swallow them, which is what really kills them.
  • When an enemy dies, it should run the die_start and die_end special functions.
  • An enemy can keep a list of variables with any name you wish, and these variables can contain any value you want.
  • When switching states, the action that switches the state should be the last one run on the event's code.

Full script guide: Object script