Giter Club home page Giter Club logo

sourcehold's Issues

Some Stronghold and Crusader modding tools.

Hi. I remembered this project exists and thought that you might find those modding tools that I'm about to show you useful in this project.
Stronghold Image Toolbox: A program that can view and modify GM1 and TGX files. http://stronghold.heavengames.com/downloads/showfile.php?fileid=4474
Official Stronghold Crusader Modding Utilities: SHC Modding Utilities made by Firefly Studios themselves. This includes an AIV Editor, a BMP to TGX Converter, and a Text Compiling Tool for SHC. https://www.fileplanet.com/archive/p-78554/Stronghold-Crusader-Modding-Utilities/download (This is a download link I could find.)

Need Help GM2 Converter

Hello metalvoidzz,

i write a new GM2 Exporter/Importer for easier editing the Images in the files but i do something wrong when i load the ByteArray for the Images
I complete to load the:
File Header
Palette
Image offset list
Image sizes list
Image Headers
Images as ByteArray

As an example i have the anim_armourer.gm1 loaded, the first picture there is 760 bytes big, but the decoding is not working right, do i have there a big mistake, maybe u can help me?

Picture of my code for decoding the bytearray:
help

ImageHeader of the first imgfile in anim_armourer.gm1
help

my decoded picture:
help

Menu boxes

The boxes used throughout the game to display messages (menu, victory screen, etc.).
Related functions can be found in GUI/MenuUtils.cpp.

  • Find an easy-to-use solution for rendering of different types
  • Make transparency/alpha blending work with SDL_Texture
  • (maybe) find an easy way to handle UI elements (i.e. buttons)

Bink video fps isn't used in game loop

Hi,

all Bink videos are playing very fast when I run the game.
It occurs after changes of 2a1902d

I have figured out that the game loop doesn't used FPS rate of the video. Here is my fix:

UIState Startup::Begin()
{
...
    while(Running()) {
...
            switch(currentStartupState) {
...
            case STARTUP_INTRO:
...
              // respect FPS of Bink video (29.97fps)
              if(delta > 1.0 / intro->Fps()*2) {
                  startTime = now;
                  intro->Update();
              }

Fps getter have to be added to BinkVideo class too.

In my tests the video speed was correct but the audio track sounds not clear. In addition, I have no idea why the fps have to multiply by 2.

Perhaps it is better to implement a timer directly in the Update() function of the BinkVideo class.

Type safety and consistency

Status Quo

  • Inconsistent interfaces across the subsystems
  • A high amount of type casting
  • Unclear definition and intention of types

Thesis

  • Revist current implementations and determine overlapping interfaces
  • Remove all type casting, if possible
  • Introduce aliases for common used types

Tgx file issue

The tgx parser will encounter errors when parsing files from the
data/gfx8/ directory.

Placing buildings

Hi,

I am not sure whether this applies to stronghold, but it may interest you to know that in Stronghold Crusader Extreme buildings are stored in an array with buildings offset from each other by a span of 0x32C. Some things that I do know are stored for buildings within their block are owner, workers, etc.:
{ "Buildings": { "address": "0x00F9C6CA", "type": "integer", "category": "building", "owneroffset": "0x4", "workersneededoffset": "0xC6", "workersworkingoffset": "0xC8", "workersmissingoffset": "0xCA", "snoozedoffset": "0x1C4", "offset": "0x32C" } }

Cfg file format

The current .cfg file has no specification.
My proposal is as follows.

Syntax

# This line is a comment
MusicVolume=42

# Whitespaces are ignored
Tax = .05f
  Username =     "Lord Stronghold"

Types

  • Integer
  • Floating Point
  • String

refactor: Renderer

  • move Resolutions to src/Common
  • remove init/destroy
  • remove unused
  • make full static class -> mandatory usage as Renderer::SomeFunc()
  • rename Render*() to Draw*()
  • overload Draw*()
  • rename *Display() to *()

#89

Sourcehold under Linux

Hi,

is the launcher made to run under Linux? At this moment I could compile the Sourcehold launcher, but I run into an error: "There appears to be no settings.ini in your installation path!"

It seems like that the settings.ini is auto generated by installation of original game. I have the original game, but I cannot run the original setup on Linux. So I never will get the settings.ini file.
For data folder I used unshield (https://github.com/twogood/unshield) to extract the cab files from original game.

Is it possible that the Sourcehold launcher creates the settings file? Thanks.

Screenshots?

I think people will be more interested in testing this reimplementation and maybe collaborate with some code if you show its current state with some screenshots (even early ones!).

Make ingame UI alive

Currently part of the UI is not rendered at all. Corresponding actions are not performed.
Here is an action plan which allows make ingame UI more or less alive:

  • Refactor Widget class and related subclasses
    -- Merge Container class functionality with Widget class to simplify widget hierarchies management.
    -- Add events processing to Widget class. This will allow us properly route events to subwidgets.
    -- Clean up Update methods in all widgets.
    -- Get rid of StaticElement. Use Widget subclass instead.
    -- Make Button widget more generic so it can be used with different background images.
  • Implement game menu (info, revert, etc.) rendering.
  • Implement game menu actions handling (show all necessary dialogs with minimal implementation).
  • Implement buildings selection menu rendering (render all buildings types, no animations).
  • Implement switching between tabs in buildings menu.

refactor: Texture

  • use as a prototype for SDL_Texture
  • differ between Static/Streaming/Target texture types
  • only allow read/write access on streaming textures
  • remove alloc/destroy functions -> constructors/destructors
  • remove unused functions/members
  • add RAII texture locking

#90

Abandoned?

Hey, I'm not a contributor or something like this, I am closer of a potential user.
I am giving a look since months ago and now I realize that the last update was made 8 months ago.
Did you guys abandoned this project? It would be a great loss, the Stronghold series are one of these games that would benefit a lot of an open-source game engine re-implementation.

Don't give up now.

Upgrading to C++17

The current master has dependencies to C++17 libraries.
Either we upgrade the codebase to use C++17, or we need to find substitutes for the following dependencies:

  • EnTT

#52

refactor: TileSet

  • inherit from a static texture
  • remove alloc/create/destroy -> constructors/destructors/helper class
  • use overloads instead of Get/Set
  • remove surface member

#92
#96

refactor: Surface

  • use Surface as a prototype for SDL_Surface (declare constants here)
  • remove alloc/destroy functions -> constructors/destructors
  • remove unused funtions/members
  • add RAII Surface locking

#90

Debug menu functionality

Add a basic menu (in the main menu) that can contain special worlds for testing functionality. Configs for those worlds should be loaded from an easy to edit file - for example json/xml/yml, or scripts - lua/js/ts/pyton which will return intermediate file.
After adding that - remove debug placeholders from in-game world loading.

See:
Lua: http://acamara.es/blog/2012/08/running-a-lua-5-2-script-from-c/
JS: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
TS: transpiling TS to JS at the runtime and then running it as the point above
Python: https://www.codeproject.com/Articles/820116/Embedding-Python-program-in-a-C-Cplusplus-code

Note - exposing API for modding is not part of this issue. Just execute scripts, get generated json/xml/yml as the result, check if it is valid, parse and load a world with the generated config.

Stronghold Definitive Edition

The title pretty much says it all, Firefly Studios recently announced the release of the Stronghold Definitive Edition, which will (or at least is trying to be) be a remaster of Stronghold 1.

What do you think of that regarding this project specifically? Will you continue or is it already pretty much dead (looks like it)? The remaster will probably address all the points you wanted to improve upon on the original game. Well, maybe all except the open-source nature of course. And oh well, I hope they make a working game and don't just release another trashy game.

feature: OpenAL Interface

  • OpenAL instantiator class
    • RAII
    • created at app initialization
  • OpenAL Source interface
    • Accesors/Settors, e.g. Vector3<float> Position(); void Position(Vector3<float> pos);
    • plays nice with <algorithm>
  • OpenAL buffer interface
    • generic buffer allocation uint8_t/uint16_t/float

Tex file format

Stores all of the text strings, but also additional info, most likely
where the string appears.

refactor: Display

  • remove init/destroy
  • make full static class -> force usage: Display::SomeFunc()
  • Use overloads instead of Set*/Get*

#89

Tidying up CMake

I think the CMakeLists needs some tidying up, alas moving it to to a more modern version.

feature: FFMPEG interface

  • RAII objects std::unique_ptr
  • simple interface to decode entire files with FFMPEG (Video/Audio)
  • works nicely with OpenAL interface

I have a question

After running the project, all the options in the game do not have text descriptions or options to enter the game. Is this normal? What should I do if I want the project to play normally

refactor: TexutreAtlas

  • inherit from a static texture
  • remove alloc/destroy -> constructors/destructors/helper class
  • remove surface member
  • use overloads or make members public, instead of Get*/Set*

#92

Discord Link Invalid

The Discord link on the README is invalid:
https://discordapp.com/invite/736X9H

Also, I just want to say, I'm excited to see this project. Really love Stronghold Crusader and I hope to be able to contribute.

I need data

Can someone tell me how to obtain the data file, or can you send me a copy directly. I'm stuck in the last step, God bless me

Make map alive - ECS/Deers

AC:

  • Create a very simple ECS
    One that can be rewritten in the future, so implementation should be done in a separate folder and the main code should call API of ECS.

  • Add Deer entity

  • Add system that can render deer
    Make it in a way that is can be easily used for other entities

  • Add system that is teleporting deers (nearby coordinates) on the map
    The throw-away system will be removed in the future, just to make things blink for now.

Note:

I want to make a proper movement system as the follow-up.

If somebody has knowledge about spawn spread pattern, please write and discuss in the comments :)
(not part of this one - just discussion point, excluded for the future:)

  • Figure out spawn pattern of entities
    This little spread at the start
    I think something detects that:
  1. "more than 1" entities are on the same coordinates
  2. It sends each entity on some nearby coordinates basing on the number of entities -> if you have 2-3 entities the spread is different than having f.e. 15 entities in 1 place.

Imported targets on MacOS

As you know, I have started cleaning up CMakeLists.txt and while doing so added imported targets like this:

find_package(OpenAL REQUIRED)
add_library(OpenAL::OpenAL UNKNOWN IMPORTED)
set_target_properties(OpenAL::OpenAL PROPERTIES
  IMPORTED_LOCATION ${OPENAL_LIBRARY}
  INTERFACE_INCLUDE_DIRECTORIES ${OPENAL_INCLUDE_DIR})

As it turns out, on MacOS this will not fly, since it fails to link frameworks correctly.
As a result, I have found this solution:

find_package(OpenAL REQUIRED)
if(APPLE)
  add_library(OpenAL::OpenAL INTERFACE IMPORTED)
  set_target_properties(OpenAL::OpenAL PROPERTIES
    APPEND PROPERTY INTERFACE_LINK_LIBRARIES ${OPENAL_LIBRARY}
    INTERFACE_INCLUDE_DIRECTORIES ${OPENAL_INCLUDE_DIR})
else()
  add_library(OpenAL::OpenAL UNKNOWN IMPORTED)
  set_target_properties(OpenAL::OpenAL PROPERTIES
    IMPORTED_LOCATION ${OPENAL_LIBRARY}
    INTERFACE_INCLUDE_DIRECTORIES ${OPENAL_INCLUDE_DIR})
 endif()

MacOS should build fine now.

Unable to open GM1 file

First of all, thank you very much for this project! Stronghold Crusader was a big part of my youth and even though I never really played Stronghold 1 itself, being able to play a FOSS version of it on my favorite OS (Linux) natively is absolutely awesome!

After linking my Stronghold 1 installation to the directory the application seems to expect (../data), the game loads up fine. However, the console logs various parser errors.

[ GAME ] -> Starting version 0.1.4 (Linux)
[ALSOFT] (EE) Failed to set real-time priority for thread: Operation not permitted (1)
[ GAME ] -> Detected edition: Stronghold HD
[ GAME ] -> Done
[ PARSERS ] -> Unable to open Gm1 file '../data/../data/gm/body_deer.gm1'!
[ PARSERS ] -> Unable to open Gm1 file '../data/../data/gm/body_lord.gm1'!
[ PARSERS ] -> Unable to open Gm1 file '../data/../data/gm/tree_apple.gm1'!
[ PARSERS ] -> Unable to open Gm1 file '../data/../data/gm/tree_birch.gm1'!
[ PARSERS ] -> Unable to open Gm1 file '../data/../data/gm/Tree_Chestnut.gm1'!
[ PARSERS ] -> Unable to open Gm1 file '../data/../data/gm/tree_oak.gm1'!
[ PARSERS ] -> Unable to open Gm1 file '../data/../data/gm/tree_pine.gm1'!
[ PARSERS ] -> Unable to open Gm1 file '../data/../data/gm/tree_shrub1.gm1'!
[ PARSERS ] -> Unable to open Gm1 file '../data/../data/gm/tree_shrub2.gm1'!
[ PARSERS ] -> Unable to open Tgx file '"../data/gfx/logo2.tgx"'!

Is this to be expected in the current stage of development and should I just have patience, or is something going wrong here?

Pre-release

Stuff to do:

  • Windows compatibility
  • Working main menu
  • Working user interface
  • Correct cutscene rendering
  • Sound effects (ADPCM)
  • Loading / Saving
  • Placing buildings
  • Simple AI / path finding

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.