Git Product home page Git Product logo

stefanhendriks / dune-ii---the-maker Goto Github PK

View Code? Open in Web Editor NEW
287.0 287.0 24.0 79.35 MB

A remake of the classic Dune 2 - The Building of a Dynasty (by Westwood Studios) with several enhancements. Like: higher screenresolutions, zooming, multiselect, skirmish play, etc.

Home Page: https://www.dune2themaker.com

C++ 91.05% C 3.75% Java 4.90% CMake 0.16% Batchfile 0.11% Shell 0.02%
cpp remake rts-game

dune-ii---the-maker's People

Contributors

mira-fr avatar paulomta-tomtom avatar pbomta avatar ruzzie avatar stefanhendriks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dune-ii---the-maker's Issues

SFML branch - segfault when scrolling up

Now that culling is done, the application segfaults when scrolling up beyond the map's upper bound. Haven't taken the time to pinpoint the reason.

That said, I think it's preferable anyway that Map holds a vector of Cells, rather than an array of static size, holding potentially half-loaded Cells.

Ability to load as MOD

Ie, make sure all gfx/audio data is outside dat files.

Then imagine a few mods:

  • original dune 2 gfx
  • enhanced dune 2
  • sega mod
  • d2tm (default)

Dead bodies / tanks should stay longer?

Something to play with, how would it look like in a battle when dead bodies stay and broken tanks on the sands? Instead of fading in a fairly short time?

Skirmish maps list should be scrollable/paginated

While working on #59 , i noticed an issue when using lower resolutions (or simply having too many maps).

The map list would continue off-screen. There is no way to scroll.

  • Add ability to go through map list (scroll? paginate?)

Example, on 640x480:
image

Support resolutions > 800x600

After #49 the next challenge is to support multiple resolutions.

This will break a few things still, because the in-game UI is fixed, see the gfxinter.dat file.

Clip viewport rendering to game window dimensions

The viewport rendering (map tiles, units, etc) draws outside of the game window.
It's neater to use set_clip_rect() to draw exactly within the allowed bounds.

This also helps to get support at a later time to draw window-in-window.

Properly deal with resolutions (for v0.5.0)

800x600 was worked on, but not working properly entirely (ie MENU looks off, as for skirmish , etc)

  • Main menu is not centered
  • Mentat is not centered #52 (delegated for v0.6.0 or later)
  • House selection is not centered #123 (delegated for v0.6.0 or later)
  • campaign missions screen (#54) (delegated for v0.6.0 or later)
  • Mission is complete window is not centered (delegated for v0.6.0 or later)
  • detect higher resolutions
  • in-game GUI should be flexible (ie, sidebar, etc)
  • Skirmish menu #59

Support skirmish maps of 128x128

Ofcourse, keeping support for the official 64x64 (or rather 62x62) maps... but for skirmish we could go up to way higher.

The dimensions could be fixed, or flexible. Perhaps up to 512x512, or even 1024x1024?

Would need to think about how to go about the minimap.

  • concentrate functions and data in one class (ie get rid of cCellCalculator, merge it within Map class)
  • get rid of the generic iCellMake and such functions (in common.*)
  • bullets should use absolute position coordinates & being rendered with them
  • structures should use absolute position coordinates & being rendered with them
  • units should use absolute position coordinates & being rendered with them
  • particles should use absolute position coordinates & being rendered with them
  • render maps < 64x64 maps properly on minimap (can be further improved, see #162)
  • test campaign missions
  • test skirmish missions (respect their dimensions - see Skirmish map: "Cliffs of Rene")
  • make it explicit what the map playable borders are (basically dimension - 2) and what the data dimensions are (ie, the 64x64 vs 62x62 case)
  • generate random maps of 128x128 instead of 64x64 (later configurable after #106 )
  • bigger maps than 128x128? (deferred to #161)

Mod: Ability to configure tech-tree

Now it is hard-coded which buildings and units are available after placing a structure. This can be made more flexible, (like work has been done for upgrades in #68). Then, it can be configured.

Once that is possible, it could even be moved outside code and into a rules.ini kind of thing?

Harvesters try to attack - when attacked

Obviously they can't, but their logic is flawed. When a Harvester is attacked, it will try to retaliate. THis might work for foot units (soldier, trooper, etc). But for other units this is stupid.

UnitMoveBehavior is used as base class

...although it doesn't have a virtual destructor.

deleting object of abstract class type ‘UnitMoveBehavior’ which has non-virtual destructor will cause undefined behaviour [-Wdelete-non-virtual-dtor]

This is the destructor in question:
UnitMoveBehavior::~UnitMoveBehavior() { this->map = NULL; this->layer = 0; }

What's the point of setting layer - a short - to 0? Setting map to NULL does not delete the object on the heap. I would suggest using smart pointers over manual memory management.

Redesign sidebar

The sidebar is based on the old C&C days. The sidebar in C&C Remastered is better, it removes the need for scrolling through lists (and using the scroll buttons). It is a bit wider, but it is not so high which makes up for it.

Todo

  • upgrades into separate list (as C&C3)
    • configure all upgrades in code
  • Do not render build count for upgrades
  • When structure is placed evaluate upgrades.
  • When structure is destroyed evaluate upgrades.
  • When upgrade is done, re-evaluate upgrades.
    • test & make sure it wont delete previous upgrade
  • move minimap up
    • when no minimap available, show house emblem
  • minimap: Without an outpost and/or sufficient power, the radar screen will only show friendly buildings.
  • move Order button to the sidebar
  • credit-bar (centered) should be 8 bit
  • sidebar should show power usage
  • spice usage
  • minimap: when clicking on it, you should jump properly to the place you where clicking... (regression)
  • topbar, show information? (selected structure? power/spice usage?)
  • Upgrading should limit build options (ie CONSTYARD upgrading should limit CONSTYARD items to being built) - and show it on icon
  • When a unit/structure is built, the related UPGRADE cannot be executed (and should show it)
  • bug: Cancel placement does not work
  • bug: when building house of IX, it adds Deviator/Devastator etc even when no heavy factory is present.
  • mouse selecting/rectangle draws over sidebar

Example of C&C (Red alert) Remastered sidebar:

image

Super Weapon: Implement Death Hand for Harkonnen

  • build death hand from palace
  • 'deploy it' (specify location)
  • death hand fires from Palace to location
  • make landing a bit fuzzy (no sniper nuking)
  • big explosion
  • auto-build next death hand (Will not do for now)
  • cells further away from impact receive less damage

Destroyed structure has only explosion at top left

Sometimes - not all times - when a building gets destroyed by enemy fire, there is only at the top-left corner an explosion. No other effects.

It is not always reproducable, so this requires a bit investigating.

Ability to zoom in / out of map

Like Dune The Golden Path does, or C&C Remastered. Using mouse wheel, scrolling causes map zooming.

With Allegro 4 it should be possible using stretched blitting.

Progress at 23-08-2020 -> https://forum.dune2k.com/topic/20495-d2tm-progress/?do=findComment&comment=400042

To get a feel what we're aiming at, see https://youtu.be/ORB9bmFvSEY?t=301 and https://youtu.be/8UxdPwxDTEQ?t=386

TODO

  • units do not attack when ordering units to attack a zoomed in structure
  • When zoomed (in or out), ordering units to attack makes units freeze. (ie, they stop moving, even when half-way cell, and they don't do anything else. They won't attack, nor move). When resetting zoom (with z), then clicking on structure to attack works as expected. (related to above?)
  • crashing when zooming too far out
  • drawing of shroud broken
  • Windtrap drawing broken
  • Drawing of placing structure is not taking zoom factor into account
  • When zoomed out, the repair icons on structures are still 100% which looks weird (icons are bigger than structure)
  • Windtrap shadow offset is wrong when zooming.
  • Prebuild animation is still not zoomed
  • Particles (smoke, explosions, etc) that have been placed are not rendered at the correct place when zooming
  • minimap broken (rectangle no longer rendered, and clicking on it does not work as expected)
  • use own stretch blit that does a bit more safety checking?
  • Explosion particle itself is ok, but the extra flare, with additive blending looks off
  • Test sound effects (distance volume feature)
  • Zooming should not move lists in sidebar (cripples easy scrolling, but it will be replaced by #68)
  • Rendering Rally point should work with zooming
  • squish particle renders not properly (wrong coordinates?)
  • some explosions seem to be wrong (tank big explosion)

Scroll map with holding right mouse button

New controls use that (ie in C&C Remastered). Hold mouse button, then move mouse (from the position the mouse was held) and use the difference to tell how to move the viewport.

todo

  • Hold right mouse button, and move causes map to move to that direction.
  • the further away from the point you started dragging mouse, the faster the movement should be
  • should take zooming factor into account (#65)
  • should not deselect selected units

D2TM/Dune 2 mode

With some own dune rules in mind, I want to be able to switch between the two so we can play the original campaign (and have a close experience to the original game) and a new experience.

Super Weapon: Implement Fremen

  • can build from palace
  • spawns Fremen (group of units) at random place at map (2 / 3 light, 2/3 heavy fremen units) (ish)
  • auto builds next (WILL NOT DO, you have to explicitly build it (as in Dune 2))

Skirmish menu should support higher screen resolutions

From #49 , currently the menu looks like:
image

(resolution 1280x1024).

Atleast:

  • top bar should cover whole width
  • "Skirmish" should be centered
  • Map list should be at the right
  • Map preview should be at the right
  • Start and Back options should be at the bottom
  • Background/Dune picture should be somewhat right/down from center

Render mouse pointer differently

Currently, the mouse is rendered on the screen via the buffer. Ie, it is not using the OS rendering of the mouse which is regardless of the FPS performance.

The desired situation is where the mouse is rendered via OS, so that even when the game performs badly the mouse stays responsive.

Also, the mouse 'feel' would be respected if using the OS cursor instead of FPS based. It is noticably different between windowed mode and fullscreen mode.

This could be achived by using Allegro's mouse routines

Mouse feels different when in fullscreen

When using windowed mode, the mouse respects the 'feel' (speed, etc) from the OS. When in fullscreen the mouse seems to be over sensitive (feels off).

I would expect the mouse to feel like in the OS.

Mentat not centered

Related to #49

image

Best would be to center the mentat, perhaps move the buttons at the bottom right?

Same goes for house briefing (ie, when you select a house you get a brief description about what this house is about):

image

Weaken dependency on Allegro so that we can upgrade to another library

D2TM is tightly coupled with Allegro 4.2. Since that Allegro version is deprecated and upgrading to a newer Allegro version (5.x) is as painful as migrating to any other library, it becomes clear that the dependency on Allegro 4.x has to be weakened to make a migration possible and less painful.

Current known dependencies

  • ALFONT (might be fine to leave this, and migrate this along with Allegro, this seems kind of trivial?)
  • ALMP3 (can be removed, feature is broken anyway) (#388)
  • FBLEND (equivalent Allegro 4.x functions exists) (#387)
  • .dat files (ALDATA?) -> #385

Once the above has been done we can start working on #386

Also, once we can migrate to another library, it would become much easier to make D2TM cross-platform (#58 )

Units of non-human player reveal human player.

In fact, units don't seem to clear shroud for any side but the human player. We want to have a shroud map (revealed or not) data per player. (which we also want for a fair AI player, don't we? :))

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.