Skip to content

A few ideas ! #328

Description

@Didiboo

Hello, I’ve been following your project for a few years now, and I’m delighted to see it becoming very active again recently.

I’ve used and modified this code extensively myself, and I’d like to submit a few ideas for your future development—feel free to do whatever you like with them!
Back in the day, I added the Egyptians and the Huns; since you’re planning to add four nations, I’d suggest moving u99 further up. This would give you more breathing room and maintain the logic regarding $tribe and $u should more nations be added later, or at the very least, it would give users of your code more flexibility.
At the same time, regarding unit data types: if you exceed 99 units, remember to change the troop fields tinyint(2) in struct.sql.

The code I originally picked up here was from 2019, and you’ve refactored a lot since then, so I can’t say for sure if this still applies. However, I recall running into an issue with the Great Barracks, Great Stable, and Great Workshop when increasing the number of nations. I’m sorry, I can’t remember the exact details... I seem to recall that the $u value would temporarily increase by 100 for "Great" building calculations, though I’ve searched your code and can’t find that logic anymore...my memory might be playing tricks on me...
In Database.php, the trainUnit and modifyUnit functions are sensitive areas; I spent quite a bit of time on them. Troops would deploy but also remain in the village, effectively doubling with every attack. Though perhaps that’s been refactored too...
It’s great that you kept the monster images (IDs 101 to 110), as it leaves the door open to using them. The rest of the data was removed, a shame, though there wasn't much there anyway... oh well!
Another quick idea:
config.php, automation.lck, and var/installed are the files created during installation.
It would be great to be able to set up multiple servers using the same codebase; the /img/en/welten folder would become useful and could be expanded with Image All tribes and classic tribes for example...

Just a thought : once the installation is complete, the files could be renamed using a prefix—for example, s1_config.php.
install/templates/end.tpl already contains this code: <?php include("../GameEngine/config.php"); $time=time(); @rename("../install/","../installed_".$time); @touch('../var/installed'); ?>. It might be easy to handle the renaming there, and then change the include statements from ("../GameEngine/config.php") to ("../GameEngine/".TB_PREFIX."config.php").
Just a suggestion...

And finally, a variable to set the default starting gold amount. Currently, the default value is 0 when the table is created; perhaps it would be possible to define this via a variable during installation...
These are just ideas :)

I think I'll set up a local installation myself soon—it's got me interested again. Good luck!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions