Cosmoteer Modding Documentation

Popular Posts

Monday, 28 February 2022

Calculating The Kinetic Energy Of A Bullet With Python


In this simple program, a simple scientific formula will be used to calculate the potential force of bullet.

Kinetic Energy is = 0.5 * m * v2 /450395

Where m = mass

Where v = velocity squared

The formulae divide it by 450295 to get the foot for pound unit that Americans use.

To turn it into joules; the result will have to be converted from foot for pound(ft.ib). To do this: the result has to be multiplied by 1.3558179483 in order to get joules.

This formulae is useful to calculate physics and potential kinetic energy of a projectile, this can be used in real life as for military purposes for example- weapon testing, prototyping, etc. This can be also used in video games as this using this formulae can create more realistic damage from projectiles.

Here is the code that's been created in python to perform this. 


In this code, the program asks the user for the weight of the bullet in grams, and the velocity of the bullet.
After those 2 variables have been accounted for, the foot to pound energy has to be calculated by multiplying the weight and the velocity squared, divided in half and then divided by 450395. The print function could be used to display the foot to pound result to the user, but joules are desired in this scenario so the next step is required:
This result is then multiplied by 1.3558179483.
This gives us the kinetic energy in joules,


Making adjustments to the code, we will now print out both the foot pound ratio and the joules in a more easier to read way.


In this example, the cannon from the Iowa-Class battleship is used, it's cannons are one of the biggest calibres. 406mm cannons.
Modern ships in WW2 or in the cold war have varying calibres for their cannons, meaning their effectiveness is not similar, these cannons can range from 20mm to 460mm. During the age of sail, galleons and canons were around the same effectives, all cannons back then were smooth bore and had similar sizes. This program is used in account of modern ships to be used in the project of the Lancaster's Law Project.










Tuesday, 15 February 2022

Modding Project For "Heart Of Iron IV" (C++)

"Iron Dimension Neptunia" 

Is a massive non-profit mod for a video gamed called "Heart Of Iron IV"

This project was started in 2021, It has gone through multiple planning iterations, and now it's prototyped in a playable state as of 15/02/2022, It's a complete overhaul of the game, changing the User Interface(UI) drastically, the story, events and player choices for a completely altered experience compared to the original base game. Developed by a small team.

I wanted to document our current progress so we could look back upon it. Partly to know what we could perform better and partly to show off what we have. This post will be periodically updated with progress reports.

This post will detail what this mod and game is all about and what the mod offers so far.

HOI4 Summary

Heart of Iron IV(HOI4) is the fourth game instalment of Heart Of Iron, developed by Paradox Studio. It's a massively popular strategy game where the player controls a nation during the time of World War 2, It follows historical events and players have a direct influence upon the world events, Their choices compared to real life decisions change the flow of the game, being a multiplayer game as well- makes every match unique, there is never a match where events happen exactly the same. Players have to react to consequences of their and other players actions and secure victory for their played nation.

The game is written in C++




Neptunia Summary

"Neptunia" is another game series where video game consoles are personified as human beings. It's a comedic anime style game series developed by Compile Heart and Idea Factory Studios. The reason why these two game series were chosen for a crossover in this project was due to the challenge of making the "happy" and "cute" Neptunia style and weave it into the dark and realistic tones of Heart Of Iron IV.

Most of the team were fans of the Neptunia games and it's Anime adaptation. 

Getting started and tools used

To get started on HOI4 modding, we had to make our own .mod file that the game reads and recognises as a modded file. This is called a descriptor file, in this descriptor file, we had to put in the path to where the mod is on our computers, this descriptor file also plays a role in allowing us to write a description of the mod that will show up on a mod page for example. More importantly, it allows the game engine to pick up our mod files. 



When modding HOI4, the game is really baked in with where it want's it's file locations at. When the team wants to edit a piece of code- we have to perfectly replicate the file structure of the game on our own mod, otherwise the changes will not be recognised by the game and it may cause the game to crash.
The mod files on the left have the same file names and locations as the vanilla game files, when the mod is activated, the mod files overwrite the vanilla game files that have the same name, thus the only files that are needed in the mod pack are ones that need to be modified, we do not need to copy all the game files in it's entirety.

Draw.IO
We used DRAW.IO to plan our flowcharts on a lot of features such as "tech trees" and general story events. Firstly: Draw.io was free, we didn't want to spend a lot of money on professional software, secondly: Draw.io was incredibly easy to pick up and use and we didn't have to spend time learning how to use it.



Trello
We used Trello as a to-do list where we could easily collaborate on things that needed to be done. It was public to view as we wanted users to know what was being updated and worked on, and they could themselves offer suggestions.



GitHub
We used GitHub to upload the mod to and share it across the team, using pull requests and such and slowly modifying the mod as we go along. Major changes to the map example may require a complete reupload of the mod to get it working on everybody's machines.



Discord
The entire operation was based on Discord, an online communications application that allowed the team to talk with each other and converse about progress and plans extremely efficiently. From long text crawls and error log sharing to voice chats complaining about the code- the project would not have lasted long without this application.

IDE
Everybody used their own IDE's to edit code, the game engine itself defaults to using notepad but I used Notepad++.


The Map

One of the first things that was planned was the complete revamp of the world and it's continents. This was an incredibly difficult endeavour. As the Heart Of Iron IV did not have sufficient mod developer tools as of this time that would make this task easier. Everything had to be done manually and it was very unforgiving.

The team desired to recreate the world of Neptunia. This is due to a lot of reasons. 

  • In most mods, maps are left completely untouched; most players are tired of the same world map based on the real world, this can also break immersion as mods basing around fantastical worlds and realms still use the base map.
  • The team wanted the experience on how difficulty the task would be, the mod community for Heart Of Iron IV frequently warned of the impracticality and difficult of building a map by hand. this was set as a challenge that the team took.
  • It would help with contextual story telling.

This is the base map in the game, Paradox put a lot of details into the map, terrain plays a huge play in battles, mountains and deserts: etc.


This is the in game map of Neptunia that the team used as a reference in map building, keep in note that Neptunia is not a top down strategy game like HOI4 but instead a turn based style JRPG where the map plays a trivial role. In the Neptunia games, the map plays a minor role as a background for a level selection.



Our first attempt at creating the map ended up being extremely tiny, this was a prototype that we eventually scrapped for a revamped version of the map. 

                                                        Version 1: Map



This is the revamped map, I created the base of the revamped map in response of the prototype map being small, the prototype played a role of a tech demo where we showed that we could make a functioning map and learned a lot from the process, we refined the techniques and knifed our previous mistakes in order to make a fully functioning map, with terrain, mountains, weather and segmented states.




To create this map, several bmp files had to be made first. 

  • This is the terrain map: colours represent what terrain certain areas of the map will have. The game engine reads the colours and links them to the corresponding terrain, placing them on the map. We discovered that if terrain colours overflowed into rivers or ocean- this could lead to disastrous bugs as grass are places on oceans and the game itself will crash. This is the same with all the bmp files we had to draw- each one had to be pixel perfect otherwise we would face bugs and crashes.


  • This is the height map bmp file where the more white parts are the more mountain-like areas of the map and the grey colours are more flat terrain, I used a white paint brush with low opacity to carefully dab on these white splodges of mountain. The ocean is entirely one shade of grey. I followed the reference image. You may think the terrain map would take care of mountains but the terrain map only colours in the map in terrain-like colours, the heightmap is the one actually giving the map it's "bumpiness" that's more visible in 3D gameplay.

  • This is the province map, as mentioned before, the world map has it's own tiny states where the the map and it's countries are split into it's own individual areas. (think US states for example) Being pixel perfect was incredibly important in this file, COLOURS were of the utmost importance, each state has it's own unique colour, the game takes this colour and corresponds the colour to a code, we soon realized that we kept breaking this file due to the fact that most painting software does not perfectly store colour data and slowly got corrupted every save. We eventually found a tool called "Paint.Net" where it perfectly saved the colour data.
  • This is the rivers bmp file, a relatively simple file that draws the river terrain upon the map.




The User Interface (UI)

One of my main jobs was to fully overhaul the user interface of the game to match the tone of the Neptunia series. HOI4's focus on gritty realism reflects on their user interface where it's mostly grey, brown and black with stamped, rusted steel. This will not work for the mod dedicated to a crossover with the Neptunia series as it's too much tone clashing to allow the player to enjoy the game. We did not have dedicated artists on our team. I had to make do with what assets and textures we had at the time.
This is the user interface of the vanilla game.

There are thousands of art assets that has to be replaced, from simple boxes to complex shapes. 




The Story

"To drive the narrative forward, we have come up with our own stories and situations where the characters still react genuinely to the events that transpire. There are events which influence both the world and the characters in different ways - some showing how they cope with sadness and pressure, some showing how they handle ambition, and even some that peer deeply into their psyche. It makes the reader empathize and connect with the characters to understand them better. "
-Clovis



Coming up with a linear story is not easy, yet we had to create a branching narrative with only snippets of story from the Neptunia games.

The Gameplay
The team believes that players would be disappointed if gameplay elements stayed exactly the same from the the base game.



Team Members
On Discord, Nicknames took the place of real names, in order to protect peoples security and privacy. I never asked for the team's real names but here are their Discord Names. 
  • Lead Developer- Clovis, the founder; a fan of Neptunia and was the first person with the idea of this project, He is the mastermind of this crew. He created the first iteration of the map, and was an all-rounder of all aspects of the project, known for the story building and world events.
  • Senior Developer - Weebly (Me): I was the second person to join the Project, I mostly focused on the UI and it's relevant coding at first but then created the revamped map with help of Clovis.
  • Senior Developer - KaiserPePe : A programmer who helped debug errors and program a new gameplay elements. He had his own mod and team that he was apart of.
  • Quality Assurance -IlikeCake:Play tests the mod and gave feedback
  • Contributor - Champion Izzy: contributed suggestions to the mod.