Code Monkey home page Code Monkey logo

nukebloodaxe / ironseed-py Goto Github PK

View Code? Open in Web Editor NEW
10.0 3.0 3.0 65.61 MB

Iron Seed is a science-fiction DOS game from 1994, which was both developed and published by Channel 7. Gameplay is real-time, featuring trading, diplomacy, and strategy. This repository contains an in-development Python version of the game engine. Note: Minimal areas are testable.

License: GNU General Public License v3.0

Python 100.00%
game science-fiction strategy diplomacy python alpha space-game

ironseed-py's People

Contributors

nukebloodaxe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ironseed-py's Issues

Game hangs, and will not exit.

There was a bug that caused the process to hang.
To reproduce:
Follow step 2 to 5 in the Readme
2. python3
3. import ironSeed
4. game = ironSeed.IronSeed()
5. Now wait until the initialisation is finished

Now try and exit.... you cannot, you need to kill the process with kill -9

My OS: Linux (Debian Sid)

It was hard to debug as the program apparently ran to end, I tried adding a final print statement, and it was printed fine. So the process should exit. But it did not.

I early on suspected some background task of pygame to be the culprit.

I narrowed the cause it down to the pygame.init being called multiply times. This happens because there is a call to this pygame.init function in the root scope of global_constants.py, causing this function to be called each time this file is imported by any other file.
I also found that this error was not consistent, some times it would exit fine with no delay and other times just hang. I also found that if commented out some of the imports, that also imported global_constants, thereby reducing the number of times that pygame.init was called, I saw a drop in the number times it would hang, confirming my suspicion that this was triggering some race condition in the pygame background tasks.

Solution: I moved the initialization of the non-primitive types inside an init function, including this call to pygame,init(). So now the pygame.init() is only called when this function is explicitly called. Also added the call to this init() to ironSeed.py.

Note: I had to inject the h.IronSeedTime object through this call to, as calling it directly from within globals would not work as it would create a circular import loop.

Allow to skip introduction

Is your feature request related to a problem? Please describe.
When game is started via game.main_loop(), introduction is run firstly... On slower computers it especially takes a long time, and after seeing it a few times, players/testers may not want to watch intro again.

Luckily, when a key is pressed while intro is running, introduction is interrupted and main loader screen with "Begin new game" / "Continue game" / "Introduction" / "Quit game" is shown.

Unluckily, when "Begin new game" is selected, the introduction will run again if it was interrupted before.

Describe the solution you'd like.
Intro should NOT be run again when any option other than "Introduction" is selected.

Crew pictures in crew selection are distorted

Comparing to original game, the crew pictures during crewgen stage (starting new game and selecting personnel) are elongated by height. Actually, whole screen is elongated (relatively easily seen also by deformed accept/reject buttons.
Python:
crew-py
FPC:
crew-fpc

Reason is probably the original was 320x200, which was double-scaled to 640x400 in FPC-SDL port, and 40-pixel black bars added at top and bottom to make it fit in standard 640x480 window. in Python, probably the easiest way is to just make a window 640x400 instead of 640x480 and it should fix itself.

original Ironseed font(s) would be nice

Original game (and FPC port) offered a choice of 3 fonts... While at resolution of 320x200 they sometimes might had some little readability problem, they were adding a lot to the atmosphere of the game. It would be nice if they could be offered as alternative.

Or at least, some monospaced font might not only look nicer, but also alleviate some problems that variable-length fonts are bound to introduce when mapped on fixed-sized backgrounds.

Not a high priority of course, especially not that I run intro and crewgen of py/fpc version side-by-side, the difference in game feel is striking!

Numbers reported by probes should be rounded

Describe the bug
Numbers reported by probes should be rounded on smaller number of decimal places

To Reproduce
Please describe the steps to reproduce the behaviour:

  1. Start new game
  2. Click on "land", "sea", "air", "life", "anom" and wait for probes to return after each one
  3. Observe results like "Atmosferic pressure: 4.1999999999999999999 Atm"

Expected behaviour
It should probable be more like "Atmosferic pressure: 4.19 Atm" or "4.2 Atm" or whatever precision is reasonable

Screenshots
probe-numbers

Probe result numbers should probably be rounded at some point

Describe the bug
Please provide a clear and concise description of what the bug is. The more information you provide, the easier it is for me to find where the problem is being created in the code.

To Reproduce
Please describe the steps to reproduce the behaviour:

  1. Start new game
  2. Click on "land", "sea", "air", "life", "anom" and wait for probes to return after each one
  3. Observe results like "Atmosferic pressure: 4.1999999999999999999 Atm"

Expected behaviour
It should probable be more like "Atmosferic pressure: 4.19 Atm" or "4.2 Atm" or whatever precision is reasonable

Screenshots
probe-numbers

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.