Skip to content

Releases: emd4600/Spore-ModAPI

ModAPI SDK v2.5.247

14 Jan 21:49
Compare
Choose a tag to compare

ModAPI SDK v2.5.236

16 Dec 15:18
Compare
Choose a tag to compare
  • Added many classes related to the skinpaint system in the Skinner namespace.
  • Added the class Editors::cEditorAnimEvent, which allows you to make the creature play certain animations while editing (the movements it does when putting a part, applying a paint, etc).
  • Added the class Editors::cEditorAnimWorld, related to creature animations in the editor.
  • Added methods SetActiveMode(), SetCreatureToNeutralPose(), AddCreature(), HandleMessage() to the class Editors::cEditor
  • Added the method SetActiveCategory() to Palettes::PaletteUI
  • Completed the class Editors::cCreatureDataResource
  • Renamed Editors::CreatureWalkController to Editors::EditorCreatureController
  • Renamed many methods in App::IMessageManager, most importantly PostMSG() to MessageSend() (to avoid confusions with MessagePost()!)

ModAPI SDK v2.5.230

14 Nov 03:01
Compare
Choose a tag to compare

Bugfix to missing cResourceManager addresses.

ModAPI SDK v2.5.229

12 Nov 20:59
Compare
Choose a tag to compare

Big changes to the Resources namespace. This update introduces the concept of Database, which is a generalization of a .package file; this is because Spore actually supports two kinds of databases: packages (DatabasePackedFile) and disk folders, which are now support in the class DatabaseDirectoryFiles.

Additionally, some methods have been added to access existing databases: check the Resource::Paths namespace. For example:

// This returns EditorSaves.package
auto database = Resource::Paths::GetSaveArea(Resource::SaveAreaID::Creatures);
//  This returns the path to the Spore folder in appdata
auto appdataPath = Resource::Paths::GetDirFromID(Resource::PathID::AppData);

Also refactored the ResourceManager and PropManager classes.

ModAPI SDK v2.5.223

06 Nov 15:51
Compare
Choose a tag to compare

Completed many graphics classes and renamed many of them, based on some information found in a SimCity executable. Completed:

  • IEffectsManager
  • IEffectsWorld
  • IVisualEffect
  • ISurface
  • IModelManager
  • IModelWorld
  • ILightingWorld
  • IShadowWorld
  • IRenderer

Renamed:

  • SwarmManager -> EffectsManager
  • IEffect -> IVisualEffect
  • IEffectWorld -> IEffectsWorld
  • RenderManager -> Renderer
  • IRenderable -> ILayer
  • ModelAsset -> cMWModelInternal
  • ModelMesh -> cModelInstance

ModAPI SDK v2.5.211

28 Oct 02:23
Compare
Choose a tag to compare

Terrain update! This update improves and adds many terrain classes like cTerrainSphere, cTerrainSphereQuad and cTerrainShaderMgr, including some of their rendering methods, like cTerrainSphereQuad::RenderWater. This update also completes the TextureManager class and improves the RenderTargetManager, allowing you to do more complex rendering.

And there's even more! To make modding the terrain easier, I've reconstructed some terrain rendering methods' source code: https://emd4600.github.io/Spore-ModAPI/_source_code-_terrain.html
For those interested in adding new star types, some star-related functions have also been reconstructed: https://emd4600.github.io/Spore-ModAPI/_source_code-_simulator.html

Added the following classes:

  • Terrain::cTerrainShaderMgr
  • Graphics::cBufferDraw, a convenience class that can be used to draw rectangles (for example, to draw textures)
  • Graphics::RenderStatistics
  • Graphics::cImageDataRaw

Improved the following classes:

  • Terrain::cTerrainSphere and Terrain::cTerrainSphereQuad, both with many rendering functions that can be detoured.
  • Simulator::cCelestialBody can be instantiated now
  • Graphics::ITextureManager, now it's completely finished!
  • Graphics:I:RenderTargetManager
  • Terrain::cTerrainStateMgr::TerrainTextures

Added new functions:

  • Many functions in the Terrain namespace, related with rendering.
  • App::cViewer: SetViewWindow(), SetViewOffset(), SetViewport(), SetPerspectiveProjection(), SetParallelProjection(), Dispose()
  • Graphics::Texture: IsLoaded(), GetLoadedRaster()
  • Simulator::cBadgeManager: AddToBadgeProgress()
  • Simulator::cPlanetRecord: GetPerihelion()
  • Simulator::cSolarSystem: LoadBinaryStar(), LoadAsteroids()
  • Simulator::cStar: GetStarType(), IsBinaryStar(), IsStarOrBinaryStar(), GetName()
  • Math: IntRectangle

ModAPI SDK v2.5.209

07 Oct 01:27
Compare
Choose a tag to compare

Added several methods related with star properties:

  • GetBinarySystemStarTypes
  • GetBinarySystemBaseRadius
  • GetSolarStarTemperature
  • GetSolarStarMass
  • GetSolarStarRadius
  • GetSolarStarRotationRate
  • GetSolarStarOrbitRadius
  • GetPlanetTemperatureType
  • IsBinaryStar
  • IsNotStarOrBinaryStar
    For those that want to add new star types, detouring these star-related methods will be necessary.

The update also adds two new methods to the StarManager related with solar system generation:

  • RequirePlanetsForStar: Call this method when you want to access the planets of a star record. Planets are not generated when the galaxy is generated, but only when their star is first accessed; this method ensures the star will have planets.
  • GeneratePlanetsForStar: Called by RequirePlanetsForStar, this method is the one that actually generates planets and adds them to a solar system cStarRecord. Detour this function if you want to change how solar systems are generated.

Finally, a new class was added, Simulator::cSpaceGfx. This class has all the effects used to display the galaxy, the "skybox" in space, etc.

ModAPI SDK v2.5.205

02 Oct 22:37
Compare
Choose a tag to compare

This update contains many improvements to planets and stars:

  • Added many fields to cPlanetRecord and cStarRecord.
  • Improved StarID and PlanetID
  • Added class SpaceNames used to generate random names.
  • Added class ResourceKeyGenerator used to generate unique keys for creations/planets.
  • Now it is possible to create instances of cPlanetRecord with all the fields necessary.
  • Added some methods related with galaxy generation. One of them is cStarManager::GenerateSolSystem(), which is called when generating the galaxy to create the Sol system (which contains the Earth, etc). This method can be detoured to add special stars or planets during galaxy creation. For example, this simple method adds the Jupiter moon "Io":
member_detour(GenerateSolSystem__detour, Simulator::cStarManager, void())
{
	void detoured()
	{
		using namespace Simulator;

		original_function(this);

		auto solStar = GetSol();

		// 0 is the Earth, 1 is the Moon, 2 is Mercury, 3 is Venus, 4 is Mars, 5 is asteroid belt,
		// 6 is Jupiter,...
		auto jupiter = solStar->GetPlanetRecord(6);

		cPlanetRecordPtr planet;
		cPlanetRecord::Create(PlanetID(solStar->GetID(), solStar->mPlanetCount), planet);

		planet->mName = u"Io";
		planet->mType = PlanetType::T0;
		planet->mTechLevel = TechLevel::None;
		StarManager.GenerateEllipticalOrbit(solStar, planet->mOrbit, 21.0, 23.0, jupiter);

		planet->SetGeneratedTerrainKey(planet->GenerateTerrainKey());
		// I just used a random terrain script here
		TerrainResourceManager.SaveTerrain(planet->GetGeneratedTerrainKey(), id("crystal_hex"), 0x4184A200);

		StarManager.CalculatePlanetScores(planet.get());

		solStar->mPlanetCount++;
	}
};

void AttachDetours()
{
	attach_detour(GenerateSolSystem__detour, Simulator::cStarManager, GenerateSolSystem);
}

ModAPI SDK v2.5.203

27 Sep 21:01
Compare
Choose a tag to compare

Several improvements to classes EditorRigblock, EditorModel, cEditorResource, EditorBaseHandle, TuningSpine. Apart from completing the structure and fields of these classes, several interesting methods have been added related to editor models. An example of what you can do:

auto resource = new Editors::cEditorResource();
Editor.GetEditorModel()->Save(resource);

// ... 
// Later:
auto model = new Editors::EditorModel();
model->Load(resource);
Editor.SetEditorModel(model);

This saves the current creation into the resource object. That creation can be later restored in the editor creating a new model, loading the resource and setting it in the Editor.

ModAPI SDK v2.5.199

25 Sep 15:03
Compare
Choose a tag to compare

Adventure editor! Added many classes and functions related to the adventure editor (adventures are known in Spore code as "scenarios"):

  • cScenarioData
  • cScenarioPlayMode
  • cScenarioTerraformMode
  • cScenarioEditHistory
  • cScenarioPowerup

And many improvements to other classes. You can access most of this using ScenarioMode, like ScenarioMode.GetPlayMode()->SetCurrentAct(3); (to go to the fourth act when playing an adventure).

There have also been some improvements to audio support. Now it supports separate audio tracks which can play a single sound at a time, and a function to stop the sound. For example:

auto track = Audio::CreateAudioTrack();
Audio::PlayAudio(soundID, track);

// ... later ...
Audio::StopAudio(track);