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.
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.
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?
When a carry-all picks a Harvester from a refinery, and drops it off somewhere on a spice field. The harvester is rendered nearby the Refinery (harvesting animation). Once the harvester starts moving, it is rendered at the correct position:
When changing the velocity, it does not seem to matter in the movement of the camera. It also does not seem to accelerate, although the code implies it should.
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.
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?
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.
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.
Ie, two trikes, move to same destination. 1 trike cannot move further due other trike blocking. Then, move air unit over trikes. The 2nd trike will move over the first trike.
I guess because of the shared 'occupied' map data.
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.
In the feature branch (shroud) we see this a lot happening. Last task should fix this. (ie, camera should never go below 1 and exceed (MAP_WIDTH - 1)). etc.
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)
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
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.
Coming from #57 .- if resource loading is uncoupled from Allegro specific libraries, we could upgrade Allegro or move to SDL or alternatives more easily.
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.
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)
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? :))