Jump to content

Recommended Posts

Hello FE community, I am a fairly new member to Serenes Forest.

Fire Emblem Recreation is a project I started independently last summer which I have worked on on my free time.

Fire Emblem Recreation will be an open source java engine for Fire Emblem. The goal is to make it easier for the community to work together and add whatever they want to their fan games. Since you can play around with the source code, you can add anything to the games. Smarter AI, new victory conditions, new map elements, pair up, and so on. The only limiting factor is the ability of the programmer.

The code is far from finished. Hell, there aren't even battle animations or dialogue. The reason I am sharing the engine at this stage is to allow others to use what I have made, because even though I plan on working more on it, I don't have much free time.

Even at this early stage, modification is extremely easy. One can change the terrain of a map (but the appearance needs to be changed separately, lol), add enemies, classes, and items by simply changing a text file. Of course, new functionalities and mechanics need to be programmed in.

Anyways, on to the good stuff. Here is a link to a google drive folder with the source code: FE_R_Google_Drive . Go wild.

The to run the code simply run the class file, FE_R_Main.class . I use Eclipse to work on java, and Eclipse has a different way of organizing the files so I simply rearranged them to run normally on a separate folder. Feel free to ask questions on how it works, I will gladly respond. I will also try to make a list of instructions on the basics soon, but don't let that discourage you from asking a question. Of course, if you improve the code share your work in this topic.

Happy coding.

Edited by TheVman00

Share this post

Link to post
Share on other sites

I almost forgot. I set the A button to J, the B button to K, and the cursor is moved with WASD. This can be changed through coding. The next thing I will do is add an options screen which allows you to customize controls in game.

Share this post

Link to post
Share on other sites

How it works:

There are three main folders: "fire_emblem", "hsa_ufa", and "Resources". In the Eclipse version, "fire_emblem" and "hsa_ufa" are inside "Source Code" as java files and "bin" as class files.

  • The folder "hsa_ufa" was not made by me and it only facilitates working with a console (window) in the code. The only class I reference in the code is "Console.class".
  • The folder "Resources" holds all of the assets and files the engine uses (other than the code), and it is split up into three more folders.
    • "Images" holds all of the image files such as map sprites (one frame per image), UI visuals, text for phases, the maps themselves (yes the maps are currently just backgrounds, they will probably become tilesets in the future). If you want to add an animation or item icon, you would have to place it in here. This folder is pretty messy right now, it should be cleaned up in the future.
    • "Fonts" holds all of the images used in creating text as individual characters. When the program displays text, it creates a temporary image of the text it wants to display using the image files in this folder. There is a class that deals with fonts and creating text called "Text_constructor".
    • "Data Files" basically holds the ROM of the game. It currently holds four text files. The program reads each the text file when it needs to know anything from the stats of a weapon, to the map layout. Each file has elements that start something like " **Element_Start " and end with " **Element_End ", and once it finds what it needs it closes the file. All files have an end to the contents " ****FILE_END**** ", and afterwards the format of how the file works is explained by example.
      • "font_data.txt" holds the information on fonts. It lists off the fonts included in the game, where each font is given a number. Each font specifies which characters it contains and the length in pixels of each character. For the engine to recognize that a new font was made, this file must be edited.
      • "item_data.txt" holds the information on items. It lists off the items that the game has by section: weapons, staves, and consumables. Each item has a number, and it tells the program its name, what type of item it is, its stats, durability, and even which image in the "Image" folder corresponds to it. Any new items must be properly listed in this file.
      • "map_data.txt" holds the information on the contents of each map. It tells the program what terrain is in the map (any unspecified terrain is considered plains), where the player's starting formation is, what new units come in during the chapter (they currently start on the map, recruitment has not been implemented), and the location of enemies. The stats and inventory of each enemy is also specified here.
      • "unit_data.txt" holds the information on the units and classes. It has player units and generic units; the player units get their stats here (class growths are not a thing yet), and both the player and generic units have their map animations here (battle animations are not a feature yet), with the amount of frames per image and the filename for each image.
  • The folder "fire_emblem" holds the source code for the engine. It has a multitude of classes with different roles. I can make an in depth explanation later on if requested, but here are the basics:
    • "FE_R_Main.java" is the class that runs the whole game, it contains the "public static void main(String[] args)". It has an internal clock which calculates when to start the next frame. It has an adjustable frame rate set to 60fps on default. This class initializes the program, it currently contains the title screen code (this is not ideal), and deals with what to do between maps. This class also deals with keyboard input and displaying the screen. All of the other classes go through here to receive input and to give output. This class also has the locations of the all the resources. "Esc" can be pressed at any time and this class will terminate the program.
    • "Map_mod.java" moderates everything in a map, the cursor, the units, the enemy AI, etc. It decides what phase it is, when classes should be able to act, and everything in a map.
    • "Army_AI.java" is the AI for any army that the computer controls.
    • "Map_unit.java" is the object from which unit instances are made. The units are stored in arrays.
    • "Map_ui.java" is the class that deals with any UI. Currently it only has UI for doing combat.

Those are the basics of the code I have made so far. I hope someone is eager enough to improve this or add on features, and look forward to updates in the future (which might not be so near). Once again please contact me if you have questions and I'd love to chat about this project here.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...