Jump to content

Dune 2000 Singleplayer game patching + new features


Klofkac
 Share

Recommended Posts

Posted (edited)

Hello all, so finally I got into Dune 2000 patching and fixing up things and adding new features!

I had a talk with FunkyFr3sh and got some useful information and stuff needed for continuation of game pathing. I'm going to use the latest FunkyFr3sh's Cncnet version as a base (not the Gruntmods version which is not the latest one and can miss some important features), which should be fine and work well. I'm using the same patching methods and tools, which is pretty easy to use and only Dune2000.exe needs to be distributed. The latest version of cncnet's ddraw.dll needs to be used so I'm putting it in the zip file as well.

I would also like to say many thanks to Tomsons26 and The Code Conqueors team for his hard work on reverse engineering Dune2000 with IDA, which helped me very much with seeing and understanding the code and which made game patching easier than it ever could be. Patching, which is practically kind of "source code modding" is lot of fun and can bring lot of new possibilities into the game.

Download here: dune2000-sp-patches_2021-07-27.7z

Put the files from config folder (misc_objects.ini + group_ids.txt + rules.ini) into your D2kEditor v2.0 config folder in order to be able to place basic static crates, use custom powerup-crate pickup animations and edit the new rules!

Feature list:

1) Crates system
- Added support for static pre-placed crates in maps + extended crates functionality and customization
- Crates can be pre-placed using special values
- You can place any crate/spice bloom types using any of 8 available graphics (4 crate sprites, 4 spice bloom sprites)
- Extended Cash crate: Can give you customizable amount of money (multiplies by 100)
- Extended Explosion crate: You can specify which "weapon" is used, crate can be detonated by shooting on it
- Extended Reveal map crate: It can reveal a circle (same as Reveal map event) in relative position near to the crate
- Extended Unit crate: You can specify which unit exactly it will give, for infantry it can give either 1 or 5
- Extended Stealth crate: Has more unit-powerup functions (heal unit, change unit type), customizable range and pickup animation
- Extended Spice blooms: More spice bloom types (classic, instant circle/square, Dune 2 style) and customizable range
- New crate type: Execute event! You can go wild and execute any event or chain of events you like.
- Fixed disappearing crates and spice blooms when AI-controlled units are nearby. AI can actively collect crates.
- AI won't collect customized explosive crates or crates with image 4
- How to use extended crates is described below

2) Events system
- Reveal map event with radius=0 will reveal whole map including radar map
(- Set tech event will also immediately update available buildings and units) - removed, will be made optional later
- Set cash event should work without crashes
- Customizable message duration for Show Message event (the Unknown value is now used as duration in ticks)
  
3) Bug fixes
- Fixed: Building upgrade tooltip now shows correct cost for easy and hard difficulty
- Fixed: Exploding barrel, sardaukar and grenadier death damage is now properly dealt in the middle of building/unit
- Fixed: Missing devastator self-destruct sound
- Fixed: Damaged unit speed (units with red health bar are now slower than units with yellow health bar)
- Fixed: MCV could be deployed on crates
- Fixed: Error messages when winning/losing as side > 2
- Fixed: Infantry rarely remaining invulnerable after being released from a destroyed building
- Fixed: AI getting stuck in infinite loop building and cancelling concrete when it's about to (re)build a building
- Fixed: AI starting building upgrade with zero credits causing upgrade stuck in HOLD state
- Fixed: AI losing ability to order units from starport after it tries to order a unit with low cash
- Fixed: Practice AI won't go/turn off berserk mode if it receives a MCV later during mission
- Fixed: Increased the message duration to 400 ticks also for built-in messages (neutral became hostile etc)
- Fixed: In-game briefing UI lockup, custom briefing will always show for any mission number or side

4) Extensions and improvements
- Extended maximum length of in-game briefing loaded from mission ini file (from 4096 to 65536 characters)
- Added support for different type of infantry released from destroyed/sold building for different side
  (This is driven by Owner side setting for unit types - the first infantry owned by a side matches)
- Added custumizable max. number of infantry to be released from destroyed/sold building and customizable chance
  (This is driven by infantryReleaseLimit and infantryReleaseChance rules)

How to place crates with special values:

Spoiler
For the basic crate types you can simply use predefined low-number special values. These are selectible in the editor's Misc objects list 
(i.e. special value 6 = cash crate, 7 = explosion crate etc). The basic crates have predefined graphics sprite.

For the extended crates you use "generalized" special values. The special value is used as a 16-bit bitfield, 
where specific bits determine crate type, sprite and other values.
The 16 bits are used in this way: 1TTTTSSSEEEEEEEE
- The leftmost bit needs to be set to 1
- T (4 bits, values 0-10) = Crate type
- S (3 bits, values 0-7) = Crate sprite 
- E (8 bits) = Extension data, these are specific for each crate type

Crate types:
0 = Cash
1 = Explosion
2 = Show map
3 = Hide map
4 = Unit
5 = Powerup (originally Stealth)
6 = Execute event
7 = Spice Bloom spawner
8 = Spice Bloom (small)
9 = Spice Bloom (medium)
10 = Spice Bloom (large)

Crate sprites:
0 = Blue crate
1 = Red crate
2 = Green crate
3 = Purple crate
4 = Invisible (one white pixel)
5 = Spice Bloom (small)
6 = Spice Bloom (medium)
7 = Spice Bloom (large)

Cash crate:
- Amount of cash = Extension data * 100
- If extension data is 0, then default amount of cash (1000), which is determined by "CrateCash" rule, is used
- Possible cash amount range: from 100 to 25500

Explosion crate:
- Extension data bitfield: DAWWWWWW
  D = Can be destroyed when shot? (1 = yes, 0 = no)
  A = Area of effect (0 = center of tile, 1 = edge of tile nearest to the unit picking up the crate)
  W = Weapon type (0-63)
- Use default crate weapon (default behavior) if extension data is zero

Reveal map crate:
- Extension data bitfield: XXXYYYRR
  X = Relative X-offset (3-bit value, possible offsets: 0, 4, 8, 12, -16, -12, -8, -4)
  Y = Relative Y-offset (3-bit value, possible offsets: 0, 4, 8, 12, -16, -12, -8, -4)
  R = Range (2-bit value, possible ranges: 4, 5, 6, 7)
- Reveal all map (default behavior) if extension data is zero

Unit crate:
- Extension data bitfield: VIUUUUUU
  V = Call MyVersionOfUnit? (1 = yes, 0 = no)
  I = Infantry amount (0 = one infantry, 1 = five infantry)
  U = Unit type (0-59)
- Give random unit (default behavior) if extension data is zero
- If "V" bit is 1, then "U" value specifies item from "Unit types" list in structures editor
  i.e. value 9 will give you either Atr, Ord or Hark combat tank depending on side you play as
- If "V" bit is 0, then "U" value specifies item from "Units" list in structures editor
  i.e. value 9 will give you Atr tank, 10 Hark tank, 11 Ord tank

Powerup crate:
- Originally Stealth crate
- Extension data bitfield: SP-MMMEE
  S = Play pickup animation and sound? (1 = yes, 0 = no)
  P = Always pickup? (0 = Pickup the crate only if it has any actual effect, 1 = Pick up crate always)
  - = Unused (reserved)
  M = Powerup mode:
      0 = Make unit stealth
      1 = Restore full health
      2 = Restore 50% health
      3 = Restore 25% health
      4 = Change unit type: 
          The target type for specific unit type is specified in unit definition in templates.bin:
          byte 0xAB: UnitUpgradeAllowed (1 = yes, 0 = no)
          byte 0xAC: UnitUpgradeTargetType
      5, 6, 7 = Unused (reserved)      
  E = Range of effect (0 = only the unit picking up crate, 1/2/3 = units max. 1/2/3 tiles far from the crate)
- You can have different pickup animation for different powerup mode. You can set the explosion you want in Structures editor
  under Other tab and set respective explosion for "E Unit powerup crate (...)" field
- Make units stealth in range of 2, always pickup, EX_CRATESTEALTH animation (default behavior) if extension data is zero

Execute event crate:
- Extension data is the number of event to execute.
- Event will be executed regardless its conditions. If you want a specific event to be run only after picking up a crate, 
  you will give it any condition that would never become true during gameplay.
- If you want to execute more events at once, you would run "Set flag" event by picking up a crate.

Spice blooms:
- Extension data: DUMMRRRR
  D = Can NOT be destroyed when shot? (1 = yes, 0 = no)
  U = Always destroy unit which moved on spice bloom? (1 = yes, 0 = no)
  M = Spice bloom mode: 
      0 = Classic spice bloom
      1 = Instant spice bloom: square, do not create thick spice, no sound
      2 = Instant spice bloom: circle, do not create thick spice, no sound
      3 = Instant spice bloom (Dune 2 style): circle, create thick spice when overlap with existing spice, screen shakes, play sound
  R = Custom range 
      For classic spice bloom it can be 0-15 (4 bits)
      For instant spice bloom it can be 0-7  (3 bits)
      For instant spice bloom the 4th bit functions as randomizer (spice will be randomly scattered rather than filling whole area)
      If crate type is Medium spice bloom then range is increased by 1
      If crate type is Large spice bloom then range is increased by 2
      For instant circle spice blooms the maximum range is 7 (limitation of CIRCLES.BIN)
      For classic spice bloom the maximum range that can be specified is 17 (15 + 2 if Large spice bloom)
- Classic spice bloom (default behavior) if extension data is zero

Spice bloom spawner:
- Always the graphics sprite number 4 (invisible, one-white-pixel) is used
- The three bits for specifying graphics are used for different purpose:
  bit 1: Respawning? (0 = spawn spice bloom only once, 1 = respawn again after spice bloom is destroyed)
  bit 2, bit3: Mode (values 0-3)
    0 = Do not place spice on the tile, the spawner will spawn a spice bloom after some time
    1 = Place thin spice on the tile, the spawner will spawn a spice bloom after some time after spice is harvested
    2 = Place thick spice on the tile, the spawner will spawn a spice bloom after some time after spice is harvested
    3 = Do not place spice on the tile, the spawner will spawn a spice bloom immediately
- The extension data are applicable to spice bloom spawned by the spawner.

Examples of use:
Special value = 32768 + (crate type * 2048) + (crate sprite * 256) + extension data

Example 1: 
Cash crate, Purple sprite, gives 3000 credits
Special value = 32768 + (0 * 2048) + (3 * 256) + 30 = 33566

Example 2:
Unit crate, Red sprite, gives Ordos tank
Special value = 32768 + (4 * 2048) + (1 * 256) + 11 = 41227

Example 3:
Unit crate, Blue sprite, gives 5 non-stealth Fremen:
Special value = 32768 + (4 * 2048) + (0 * 256) + 64 + 22 = 41046 (without MyVersionOfUnit)
Special value = 32768 + (4 * 2048) + (0 * 256) + 128 + 64 + 19 = 41171 (with MyVersionOfUnit)

Example 4:
Explosion crate, Small Bloom sprite, uses "DEVASTATOR" weapon and its hit explosion
Special value = 32768 + (1 * 2048) + (5 * 256) + 128 + 64 + 18 = 36306

 

Please test the new features and let me know if you see any problems.

Here is github repository with my own added patches: https://github.com/jkoncick/dune2000-sp-patches

Edited by Klofkac
  • Upvote 2
Link to comment
Share on other sites

Posted (edited)

Update from 2021-05-20:

- Extended maximum length of in-game briefing loaded from mission ini file (from 4096 to 65536 characters)
- Fixed disappearing crates and spice blooms when AI-controlled units are nearby
- Made set cash event set the cash instead of add

First post edited and download link updated.

Edited by Klofkac
Link to comment
Share on other sites

Update from 2021-06-05:

Extended crates functionality and customization
- You can place any crate/spice bloom types using any of 8 available graphics (4 crate sprites, 4 spice bloom sprites)
- Extended Cash crate: Can give you customizable amount of money (multiplies by 100)
- Extended Explosion crate: You can specify which "weapon" is used and use that weapon's hit explosion
- Extended Unit crate: You can specify which unit exactly it will give, for infantry it can give either 1 or 5

First post edited and download link updated.

The first post contains description how to use the extended crates.

Link to comment
Share on other sites

Posted (edited)

This is a suggestion I would like to do.

I feel like to place any crate that it doesn't use any default value (1000 credits, a random unit, reveal map) it is going to be really hard doing all the calculation needed and triple checking the values one by one (if base, this + that x the-other + more), and instead going for a friendly user way to achieve this, although this could be tons of work for you.

My idea was when I pick the crate that is about money and about to place it into the map, apearing a windown similar to the "new map", where you manually write the value of the crate that will worth when being picked, just indicating that the value needs to be "X00", in a line on that windown or as an error if somebody writes a non valid value, just like this:image.png.e1e90ac8d539a9c96a17cba8227038e0.png 

Either appearing this kind of windown everytime you place a crate, or double clicking into the graphic of the crate to change; the editor will use whatever value used.


Similar for making to appear a custom unit: If I want a MCV, I need to apply a formula and checking all the specific values just to make it to appear; so I was thinking in some sort of windown that contain a list of the available units, which could reuse the list of the unit spawn-drops-deliveries (so if any custom unit were added it appears there too), and after clicking on the desired unit, maybe a second check with the "only 1 unit / 5 units, but only for infantry" or whatever that part was refering. Dunno if really possible for the editor, doing this, to check if the unit is a vehicle or an infantry to disabled or not the "spawn 5 units", so only with infantry people can mark the "spawn 5", but if this are beyond the limit, then just leaving it available for all but informing somewhere on that windown that will only work with infantry units.


With this, the editor will do the map for the modder, and will help new people to add this, if they want, more easily withouth needing to read another manual.

Edited by Cm_blast
Link to comment
Share on other sites

Posted (edited)

Hey Klof, dropping some junk here from the Discord.

Here's the to-do list:
 - Investigate the crash with many unit crates next to each other? Perhaps that's not too difficult a fix. Maybe worth a cursory glance.
 - Add check for hit explosion when placing a crate using a weapon without a hit explosion.
 - (Explosive only?) Crates destroyed by firing on them.
 - Upgrade costs don't properly display; they ARE affected by difficulty level, but only ever display the normal difficulty price.
 - Explosive barrel and Grenadier death explosions don't occur at the center of the structure or unit itself. Can cause crashes.
 - Would it also be possible to stop the AI from scanning for and attempting to pick up explosive crates, for one?
 - The Light Infantry invincibility glitch we spoke about on Discord. Can anything be done about it?
 - Unknown side for winning / losing movie error needs investigation.
 - Devastator self destruct doesn't make a sound. Can that be fixed?
 - APCs possible now? xD (impractical, not bothering with this)
 - Messages persist for a shorter time now. The duration before was 400 tics; this could use a fix.
 - On that note, perhaps message duration could be another custom [Vars] thing? Or an event parameter?
 - There appears to be a problem with saving custom messages in the editor. Changes won't apply sometimes.
 - The AI sometimes gets in a loop of building and canceling concrete for a building if concrete is already there.
 - The AI loses its ability to order units from the Starport if it tries with low cash, until an event delivers one. Bug?
 - Game locked up when attempting to view the briefing in the new exe. I was in windowed mode, if that matters.
 - Can a different infantry type be assigned to spawn from a destroyed or sold building belonging to a certain side?
 - On that note, is it possible to change the cap for the maximum amount of infantry that can spawn from a building?
 - Practice mode AI goes berserk before getting an MCV. Is it possible to turn berserk off when the AI gets its MCV?
 - Units slow down after half HP, then speed up with low HP. Could this be changed? Perhaps through a new [Vars]?
 - MCVs can deploy where crates are. Structures can't be built atop crates, but ConYards spawn with some funny results.
 - Structure tech trees remain intact even if you sell dependencies, but units don't. Is it possible to fix the structure tech tree?
 - Did you happen to fix the issue where teams allied with a sandworm will keep force-firing on the sand where the worm was killed?
 - Messages that're built in, like "faction has turned hostile," are still very short. Can ya bump them up to the new default duration, 400?
 - Saboteur stealth time is short. Do you suppose it'd be possible to add a variable for the time it stays stealthed, similar to DH accuracy?
 - The score screen appears after every mission with your latest exe. Possible to fix the errors and such on it so it displays score properly?*
 - Can guard mode radius be changed? If possible, perhaps it can be made to be affected through a new .ini [Vars] behavior?
 - How about self heal max HP? Speed? Can those factors surrounding self healing be manipulated through new [Vars]?
 - I believe you spoke about a [Vars] editor for the d2k editor that manipulates the vars.bin itself, not through an ini.

* Regarding the score screen errors...

Spoiler

1593188931_scoreshenanigans.png.1f67c8a94853782e76eb13f675db8b47.png

Mission number is easy to change. That's adjusted via the in-game mission settings. It works past 9, but the d2k editor doesn't like to keep values in the box that are above 9.

The House sigil appears to change at times. Could be Atreides, Harkonnen, or Ordos, and seems to depend on which Houses are present on the map. The "House" column in the High Scores thing sometimes reads "Error," but never says you're playing as a House other than any of the first three. Uhh... the score sometimes doesn't ever get calculated and just sits at "0" the whole time, which occurred in this screenshot. Of course, that's only the numerical value! The meters, as you can see, have moved to indicate something is calculated, if not the numbers. It also seems that the Spice harvested accounts for the Spice an enemy starts with, and that can ruin the score very easily if there's an AI on the map that isn't meant to run out of money. The high scores are also not saved for custom missions, which I suppose doesn't matter at the moment since the score screen is pretty broken.

I also found this error which further suggests the score screen is based on whichever Houses are present on the map:
xhzinfbgbhizxg.png.5eedb7442ebe85acdd1f204b15639e5a.png
^^^ On a map where the player is mercenary and the enemy faction is a variety of Guild sides, all colored cyan or CABAL blue.

Perhaps it would be worth fixing the score screen for all the custom campaigns out there. :P I hope my error reporting helps.

Edit: Updating the list as you report fixes on the Discord.

Edit 2: I spaced out the "spawn unit" crates by one tile each, and put walls between each one, and then sent a bunch of vehicles through them all. Still got the game-crashing error of "unit already in tile." Also, I can deploy an MCV on top of crates. The structure is created, it simply prevents the concrete from spawning where the crate is. Normal structures seem incapable of being placed on tiles occupied by crates. Seems like that first issue is kind of a big one and is more likely to happen than I thought.

I also discovered that crate graphics can't be realigned. Not really a problem, but it did require a bit of a workaround to get some unit graphics in there. Speaking of, been fucking around with some graphics too. Here are some landmines, incomplete Harvester and MCV, and TibSun crates:

Spoiler

If it's of any help, here are some screenshots of the area with the spread units so you know the circumstances under which I got that error again:

Spoiler

683663779_autogunsonRFGs.png.1e35044dff1e7c1d72b790207cccac68.png

Under these circumstances, I was NOT able to get the error by simply touching the Flame Tanks without breaking any walls or Munitions Silos. That was fine. However, when I destroyed the Munitions Silos and broke the walls, the two Duelist Tanks I began with and the ten Flame Tanks parked there were enough to cause the error at some point. On my first attempt to get the error.

When I removed some the Flame Tanks and sent a ton of existing units through the area however:
343666833_lessFlameTanks.png.a290f0e9e1d9e9fe90242e296b785750.png

That was fine. No error, multiple attempts to get the error. Even with that many units yeeting through the area, all of the Flame Tanks were spawned as intended and none of the tanks clipped through them.

Hopefully this helps get to the bottom of the most alarming error. :P

Good luck! And thanks again.

Edited by Fey
Link to comment
Share on other sites

On 6/7/2021 at 1:51 AM, Fey said:

Messages persist for a shorter time now. The duration before was 400 tics; this could use a fix.

I can confirm this. If you want a quick test yourself, you only need to start my "The origin of the mercenaries" campaign first mission; That one start with a initial custom message and then a few seconds later another one; it used to stack, with a couple of seconds being the two together to make the player to know that they were chained and it wasn't any "empty" moment in bewteen messages since nothing is happening and it is not really a "rush anything" kind of mission.

With the lastest exe (not sure with the previous one) the messages are much shorter and it doesn't longer stack.

Maybe it can be added a way to control how long they are (but still keeping the default duration as it used to be).

Link to comment
Share on other sites

Eh, you got crazy with the number of things I should look at and fix, lol. Not sure if I will manage everything, and I'll take my time. I got also my own ideas what new stuff to add, I believe you will like them.

On 6/7/2021 at 1:51 AM, Fey said:

- Messages persist for a shorter time now. The duration before was 400 tics; this could use a fix.

Oh, really strange, no idea, maybe the exe FunkyFr3sh provided to me is somehow different. I'll take a look at some time, thanks Cm_blast for the tip.

On 6/7/2021 at 1:51 AM, Fey said:

- There appears to be a problem with saving custom messages in the editor. Changes won't apply sometimes.

Yes I noticed that myself and fixed that, will be part of next editor release (the last release was a not the final v2.0, so luckily I still have place for such bug fixes). It was caused by the new auto-apply feature.

On 6/6/2021 at 10:57 PM, Cm_blast said:

I feel like to place any crate that it doesn't use any default value (1000 credits, a random unit, reveal map) it is going to be really hard doing all the calculation needed and triple checking the values one by one (if base, this + that x the-other + more), and instead going for a friendly user way to achieve this, although this could be tons of work for you.

I'm planning to implement a user-friendly way to place customized crates in the editor. But that will be done later, I still want to finalize (finally!) the version 2.0 which will not have this yet, but just after that I'll start v2.1 where I will only concentrate on adding stuff which I add within exe patching. Of course it will take time.

Link to comment
Share on other sites

5 hours ago, Klofkac said:

you got crazy

Sorry :) Hey, take your time! I'm just, you know, putting all the stuff out there, we're entirely dependent on you for what happens and what doesn't. So have a cursory look, or not, and I'm grateful for whatever we get. Thank you!

I'll mark off crates destroyed by firing on them and the message saving thingy. And, uhh, I was asked if APC behavior could be created now, so I'll tack that on. According to tomsons26, that wouldn't be as simple as copy-pasting from RA code, but, we could take the design idea from the RA code to use as a framework for how it works.

Link to comment
Share on other sites

Yesterday I implemented the extended reveal map crate, which would reveal a circle in a place near to the crate. I was also experimenting with a crate which would change unit stats (basically extending stealth crate). Changing health (i.e. full or partial healing) was pretty straightforward, but changing other stats (I wanted to try changing unit speed or rate of fire) was not much possible through. That would require additional changes in code, so that individual unit's value is used instead of global value for respective unit type, specified in templates.bin. But one interesting thing, I tried changing unit's type for existing unit on the fly, and that kinda worked. Wonder whether that would be any useful, but seems rather as obscure thing to me. I could also change the range of effect for the stealth crate. By default it turns stealth all units which are at most 2 tiles far from the crate in both X and Y directions. You could probably give me ideas gow the crate could be customized (i.e. different kinds of effects, customizable range etc).

Basically I'm now concentrating on implementing the extended crates, after that I will take a look at the points and bug fixes reported by @Fey one by one.

Link to comment
Share on other sites

Update from 2021-06-16:

- Fixed crash when picking up many unit crates next to each other
- Made explosion crates shootable (can be specified for each crate individually)
- Extended Spice Bloom and Spice Bloom Spawner crates: More spice bloom types (classic, instant circle/square, Dune 2 style) and customizable range
- Extended Reveal Map crate: It can reveal a circle (same as Reveal map event) in relative position near to the crate
- Extended Stealth crate: Has more functions (heal unit, change unit type) and customizable range

First post edited and download link updated.

Link to comment
Share on other sites

If possible to achieve, I would to like to have a both "insta-tech" and "delay-tech".

I just realize that I have been using the original increasing tech behaviour more often that I though.

2 missions I know that are affected (1 for balancing purposes, the other for timing on a "cutscene"), and I have at least other 2 with the "set tech" although not sure right now if it really will change the mission at all or maybe it doesn't.

So, I was hoping that if you can implement on the editor/exe a way to have two options to set.
-Set tech = delay <-- which means that any new tech won't become available not until the player do upgrades or place a building (so like it was).
-Set tech = instant <-- which means that any new tech will become available as soon as the event trigger.

Since most of the set-tech mission were done by modders knowing that the tech won't become available from the moment that the event triggers (with in-game messages warning about that, giving extra money to use on those upgrades); I would say to use the "buggy" version as the default one, while allowing new campaigns/modders to use a "instant" version for their new ideas.

Link to comment
Share on other sites

Posted (edited)

Update from 2021-06-16:

- Added new crate type: Execute event
- Added possibility to specify different pickup animation for different powerup crate mode
- Changed "Set tech" event to behave like originally, the new behavior (immediate update of available buildings and units) will be made optional later

First post edited and download link updated.

Edited by Klofkac
Link to comment
Share on other sites

Something new to add to the list.

-If the Ai start upgrades having no money, it will get stuck with the upgrades at "hold" not reaching any further tech.

So if a Tech 7 AI with 1000 credits will do the CY upgrades (assuming no harvester has returned and no money was spend on something else), it will finish that upgrade, then entering the Barracks upgrade at hold and will remain like that for the rest of the mission.

This happens only if the ai has exactly 0 credits starting an upgrade, not during it.

 

Link to comment
Share on other sites

Since you talked about removing the limit of units-structures for every side, instead of a total of 1000, 1000 per side (so around 8000 objects to be used), there is a problem but don't know if it is a bug or just a ingame limitation.

On my Coalition of Nobles Bonus mission the 3 enemy Ais used to have 5 heavy factories, 5 light factories, 3 Starport, 3 Ix, 3 HTF, 9 Refineries, 3 CY....

The amount of objets was around ~980 with 6 Ais + player; but I found out that 2 out of 3 enemy Ai were getting his building production grey out (after a couple of seconds).

Although it didn't happen every time, at least 1 every 3-4 times I started the mission 1 of the AI (sometimes 2 of them) got the structure queue disabled. It didn't matter if I was not controlling the Ai, or controlling it and trying to left/right click on any building with no responde.

Not sure how you can replicate this, but maybe you can make an AI to have 950 objects on the map (multiple refs, facts, CY and tons of walls, for example) and see if that happens, and if that happens, either fixing the .exe, or if that doesn't have a proper fix then simply removing the option to make every Ai to have 1000 objects as the ais cannot handle that many anyway.

Edited by Cm_blast
Link to comment
Share on other sites

Update from 2021-07-01:

- Customizable message duration for Show Message event (the Unknown value is now used as duration in ticks)
- AI won't collect customized explosive crates or crates with image 4
- Fixed: Building upgrade tooltip now shows correct cost for easy and hard difficulty
- Fixed: Exploding barrel, sardaukar and grenadier death damage is now properly dealt in the middle of building/unit
- Fixed: Missing devastator self-destruct sound
- Fixed: Damaged unit speed (units with red health bar are now slower than units with yellow health bar)
- Fixed: MCV could be deployed on crates
- Fixed: Error messages when winning/losing as side > 2
- Fixed: Infantry rarely remaining invulnerable after being released from a destroyed building
- Fixed: AI getting stuck in infinite loop building and cancelling concrete when it's about to (re)build a building
- Fixed: AI starting building upgrade with zero credits causing upgrade stuck in HOLD state
- Fixed: AI losing ability to order units from starport after it tries to order a unit with low cash

First post edited and download link updated.

Link to comment
Share on other sites

  • 4 weeks later...
19 hours ago, Cm_blast said:

This is something that I though of.

It is well know that an AI sending an engieneer to capture another structure will sell it right away. I wonder if there it could be a way to make an specific AI (or engie) to not sell the building captured.

That was something I was thinking about myself! This could be an improvement that would make AIs more useful and acting more logically. I will take a look at this at some point in future.

Link to comment
Share on other sites

I mean, logically the best thing any player can do is selling the building as fast as possible because that's some money, not allowing the rival to counter-capture the structure. 

Not only that, but an AI capturing a building and keeping it alive will make his natural defenses to cover the whole terrain from their base into your base, so they will send all the defensive units against your turrets or whatever and from this moment, sending every piece of unit he builds to his death because he keeps trying to "protect their base".

Of course, I am talking on regular Ais and maps. The current behaviour is the best. Of course, for custom missions there are enough ways to make other objetives or defence areas or not even a GGS to do that kind of stuff.

It could even go even far away and making the engineer to not sell the building if it cost 500 or less, as for any human player it is cheaper to build a different barracks than recapture it, so keeping alive may annoy the player removing room or having to destroy it or whatever.


There is also another thing I mentioned at some point, although people will hang me (us) to implement the option to not abuse the "order-cancel" to avoid the silos needed dialogue. So on a "harvest 15.000 spice" from the original campaign, no way to not store that amount but building silos, as cancelling an order will revert the spice into storage.

Link to comment
Share on other sites

9 hours ago, Cm_blast said:

Not only that, but an AI capturing a building and keeping it alive will make his natural defenses to cover the whole terrain from their base into your base, so they will send all the defensive units against your turrets or whatever and from this moment, sending every piece of unit he builds to his death because he keeps trying to "protect their base".

Ok, thanks for mentioning this, I was not thinking about it.

Here's my point: Imagine a practice AI player loses its construction yard and cannot obtain MCV in any way, but still has barracks and can make engineers. Then I was like "ok, I deploy extra CY just for you to capture, then you get a CY and can build new buildings again". AI player eventually captured the CY, but sold it immediately anyway, and I said "How DUMB!!! Here you got a CY and got rescued, but you sold it, how you are STUPID dumb ass!". So for such situation, more logical behavior would be keeping the CY and I wished AI did so.

But as you say, it's hard to make it perfect, as keeping captured structures would also have unwanted side effects.

Link to comment
Share on other sites

37 minutes ago, Klofkac said:

unwanted side effects.

But! An AI can be set to not use its GGS, and there are other ways to make it work.

Making it a rule that it doesn't sell its captured structures could be useful, so I am for it. :P Although I would also add that if an AI captures a structure and doesn't sell it, it'll try to make it its primary building. That way if it IS going to produce units, they'll emerge where they're needed.

Edited by Fey
Link to comment
Share on other sites

5 hours ago, Klofkac said:

Ok, thanks for mentioning this, I was not thinking about it.

Here's my point: Imagine a practice AI player loses its construction yard and cannot obtain MCV in any way, but still has barracks and can make engineers. Then I was like "ok, I deploy extra CY just for you to capture, then you get a CY and can build new buildings again". AI player eventually captured the CY, but sold it immediately anyway, and I said "How DUMB!!! Here you got a CY and got rescued, but you sold it, how you are STUPID dumb ass!". So for such situation, more logical behavior would be keeping the CY and I wished AI did so.

But as you say, it's hard to make it perfect, as keeping captured structures would also have unwanted side effects.

Yes, I know. Is like everything, making a big Ai base that cover the whole mission it won't work unless a defence area is used (no westwood mission use defence areas besides the Fremen even on missions where it could benefic, like A4v1, where the enemy are 2 ais but one of them only just control 2 windtraps that does nothing but simulate that they surrounds the Fremen.

Unless a new line on the AI behaviour could be added like "selling capturing buidling 0 - 1 ".
or, a Engie in "hunt" will sell it, and in "free" don't.

I know there is a custom campaign over there, one of those really old before the editor could allow use to place any Harkonnen Palace for other factions but Harkonnen, that the author had an AI with the full base deployed, using the Imperial index, I think; and then a lonely Harkonnen CY on a side of the map. The AI with the full base spawn an engie next to it at the very beggining, it will capture the CY making the Harkonnen palace to be available, so that AI just build and deploy their own Harkonnen palace.

Of course, this was before you could place 8 Harkonnen palaces from 8 factions if you wanted.

4 hours ago, Fey said:

But! An AI can be set to not use its GGS, and there are other ways to make it work.

I literally said it.

14 hours ago, Cm_blast said:

Of course, I am talking on regular Ais and maps. The current behaviour is the best. Of course, for custom missions there are enough ways to make other objetives or defence areas or not even a GGS to do that kind of stuff.

I just mean that in "regular maps" the current behaviour is the one that it doesn't harm the AI, so it is not like the current design is bad.

The thing is that if we are given a choice, via the editor or AI values or whatever to make mission X to not sell buidings, but mission Y it returns to the original behaviour then it is fine, but forcing all the engies to not sell for every maps and missions done could be pottencially bad and not worthy just because you can think on 1 mission to use this (while affecting negatively every vanilla-skirmish mission and so many old campaigns with people using skirmish Ais so often).

Or, that mission I mentioned early, with the lonely CY meant to be capture so the Ai can deploy the Harkonnen palace; but the CY not being sold is going to mess the AI.

But yes, given the option it can be used to do missions, it doesn't need to be the player.
On one mission I have a really big Ixian base at the top area, which contain 3 Ais, 2 of them use a defence area around 2 abandoned machine bases. These machine bases don't do anything, they simply have the buildings.

Plot wise, the Ixians are trying to find "something" so they are scouting, exploring, researching... these abandoned bases. The player's objetives is to destroy the abandoned bases (only guarded by Ixians) but ignoring the big ixian base at the top.

This could use "not selling engies" and making those 2 Ais with the defences areas that are already on top of those machine bases to send engineer after engineer (or it could even be a 4º AI with a really slow pace only training engie after engie), with the goal of destroy the machine buildings before the ixian fully capture it.

This could be a good potential use. Letting the AI to keep the "abandon base" the same way a player could do if he want, and even use the buildings to increase the army or making it the mission win/loose.

Edited by Cm_blast
Link to comment
Share on other sites

I would like to ask whether it is possible to increase event queue size (current: 63) and/or maximum map size?

Also, is it possible to define more custom events like "grant X credits" or "change owner of all structures of player X to player Y" or "order unit id 1234 to patrol from (12, 12) to (24, 24)"...?
 

Link to comment
Share on other sites

Update from 2021-07-27:

- Fixed: Practice AI won't go/turn off berserk mode if it receives a MCV later during mission
- Fixed: Increased the message duration to 400 ticks also for built-in messages (neutral became hostile etc)
- Fixed: In-game briefing UI lockup, custom briefing will always show for any mission number or side
- Added support for different type of infantry released from destroyed/sold building for different side
  (This is driven by Owner side setting for unit types - the first infantry owned by a side matches)
- Added custumizable max. number of infantry to be released from destroyed/sold building and customizable chance
  (This is driven by infantryReleaseLimit and infantryReleaseChance rules)

First post edited and download link updated.

8 hours ago, Runtowin said:

I would like to ask whether it is possible to increase event queue size (current: 63) and/or maximum map size?

Also, is it possible to define more custom events like "grant X credits" or "change owner of all structures of player X to player Y" or "order unit id 1234 to patrol from (12, 12) to (24, 24)"...?
 

Maximum map size cannot be increased, unfortunately.

I'm planning to do some improvements to the events system and add some new event types, according to how much possible it is to implement and integrate into game code.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...