Log In  

Cart #undune2-3 | 2022-03-30 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA


UnDUNE II is a demake of the classic (and original) RTS game DUNE II, re-created from scratch in PICO-8.

A strategy-based resource management simulation, where three houses fight for control of the planet Dune - the land of sand and home of the spice.

This project started as a fun idea, that I expected to get done within a month or two.
Well... almost 3 years later (working on & off, in my free time) - I'm happy to say that it is finally finished! πŸ˜…


πŸ‘₯ All 3 Factions (+Sardaukar)
πŸ‘¨‍🏫 All 3 Mentats (+Bene Gesserit)
οΈπŸ—ΊοΈ All 9 Mission Levels (inc. anim map w/ intros)
πŸ”Š Music + SFX remade for PICO-8 (by @Gruber)
🏭 All 19 Building Types
πŸš› All 21 Unit Types
🏯 All Palace Weapons
🏨 Capture Buildings (inc. Harvesters)
πŸ› Sandworms
️⛰️ Multiple Terrain Types
️️⛏️ Spice Blooms
🌁 Fog of War
πŸ“‘ Low/High-res Radar
πŸ€– Multiple AI Opponents
πŸ’Ύ Auto-saving after each Level
πŸ“Š Level End Stats (w/ Rankings)
πŸ’Ύ ️Spanning 12 PICO-8 Carts
οΈπŸ–±οΈ Mouse/KB/Gamepad/Mobile-Friendly
⏳ HOURS of gameplay!


Mouse (Recommended)

  • Left-Mouse-Mutton: Select Unit/Building, Choose destination/target
  • Right-Mouse-Button: Deselect/Cancel



If you've never played the original (or an old-school RTS) before, the basic principle of UnDUNE II is as follows.
Build up your base by ...building! (just remember to put down concrete slab foundations before placing your buildings, to avoid damage).

Wind Traps generate electricity to power your buildings. Refinery's take raw Spice (mined by Harvesters), which are converted into credits, to allow you to build more! Take your units and explore your new terrain.

But watch out, as you are not alone. There are two other foreign factions that will fight you for control of Dune. Not to mention the native lifeforms - such as Sandworms, which can swallow units whole!

Units can be instructed to attack enemy units and may automatically retreat when outnumbered. Harvesters will automatically try to find the closest spice, but can also be told where to mine - they'll also automatically return to base for unloading when full.

Grow your base, expand your building options as you go (more will unlock at later levels). Preserve your Construction Yard at all costs - you can't build another one!
(unless you have an MCV...)

Good luck! πŸ˜€πŸŽ–οΈ
...feel free to share any cool pics/vids using #UnDUNE2 hashtag


Pre-built Win, Mac, Linux, RPi executables can be downloaded from the UnDUNE II itch.io page.


  • Improve radar quality by building a Radar Outpost
    (ensure sufficient power levels are maintained to keep operational)
  • Certain buildings require other buildings to be built before they will be available.
  • Other buildings and units will unlock at the later levels.
  • If you need credits fast, you can send a Harvester back to Refinery early.
  • Some units are only available to certain factions -
    such as Harkonnen Devastator, Ordos Deviator, Atreides Sonic Tank.
  • Build a Repair Centre and units will try to go directly to them get fixed without you having to tell them.
  • Build base foundations quickly by placing 4x4 Concrete Slabs (when unlocked)
  • Build a Carryall as soon as you can (via Hi-Tech Factory) -
    as they will pick-up/drop-off units (such as Harvesters and retreating units) MUCH faster.
  • Trikes are fast and inexpensive - use them to scout enemy bases
    (just make sure you're prepared for a fight once they know where you are!)
  • Sandworms cannot "eat" units if they are on land.
  • Spice Blooms (mounds) can be shot to release payloads of spice.
  • Build an MVC and send it into corner of map
    so you have a "backup" Construction Yard, should your only one be destroyed.
  • Target enemy Spice Refinery first, to stop them from earning credits,
    then go for their Repair Facility and then Unit Factories.


πŸ‘¨‍πŸ’» Code, PixelArt:
Paul Nicholas - (Liquidream) - https://www.liquidream.co.uk

🎢 Music & SFX:
Chris Donnelly - (Gruber_Music) - https://www.grubermusic.com


οΈοΈπŸ–ΌοΈ "Dune Nights" Cover Art by Ahmad Alromeadheen (@AAlromeadheen)
πŸ•ΉοΈ Playtesting by Tim Hicks, Krystian Majewski, Chris Donnelly, Dylan Bennett, Maxwel


Rotate Sprite and Raycast 3D Title snippets by @freds72
TLINE Sprite Rotation snippet by @TheRoboZ
PX9 Data Compression by @zep
Good Enough Minifier for Pico-8 by Paul Hammond
picotool (luamin) by Dan Sanderson
Retrospecs by John Parker
A* Pathfinder and Particle System by @morgan3d
Bitmasking example by @MrBigaston
Dialog Text Flow w/ Coroutines by @MBoffin
Palette-Maker by @2darray
• "UnDUNE II: The Demaking of a Dynasty" name suggestion by @thattomhall
• Westwood Studios for creating such an inspiring classic game.



FIX: Display issue caused by P8SCII changes in newer P8 builds

ADD: End Credits screen (also accessible from main pause menu)
ADD: Auto-return repaired units to battlefield
ADD: Made it easier to start a new game/switch house
(also via Title cart's "pause" menu)
ADD: Starport now has fluctuating pricing to order from
ADD: Prioritised AI attack  for buildings + periodic attacks until "discovered"
ADD: Hitpoints, Power and Arm stats added to build menus
ADD: AI will now retaliate against attack!
ADD: Atreides can now control Fremen (after initial target order)
ADD: Made it easier to start a new game/switch house
(via Title cart's "pause" menu)
CHG: Better FOW reveal shape (was square before)
CHG: Launcher tanks now have minimum firing range
CHG: Unit order feedback
(now deselects when tell to move - consistent with attack)
CHG: Unit cap now set for each faction, rather than total count
(+now applies to soldiers created on building destruction)
CHG: Build menu now matches ordering of original game
CHG: Increased pathfinding memory (fix broken pathfinding on LVL 9)
CHG: Improved sprite gfx (turrets, storage silos)
CHG: Credit sfx interval reduced (+build/repair speed tweaked)
CHG: Sonic tank + Trooper fire/missile size
CHG: Repair rate reduced slightly (was too fast)
CHG: HQ Radar now shows FOW now more accurately
CHG: Enemy unit/turret fire FOW reveal reduced (was too large)
FIX: Diff. faction level req. for some buildings (Light Factory, WOR, etc.)
FIX: Slabs placed under units are now lost
FIX: Abort attack when unit is collected by carryall
FIX: Build Placement now ignores flying units
FIX: Tech tree requirements
FIX: Broken turrets mid-level
FIX: Ordos now start with Deviators not Launchers on later missions
FIX: Click close menu sometimes triggered radar move
FIX: Crash if click build with no build menu items
FIX: Worms can no longer "eat" flying units
FIX: Now only infantry soldiers are created when buildings destroyed
(not troopers) + reduced count
FIX: Infantry/Troopers reduce too quickly from 3 down to 1
FIX: Harvester info now resets to 0% after unloading
FIX: AI able to build units on levels earlier than should be
FIX: "never the less" Typo on Harkonnen Mentat screen (bug in original)
FIX: Units sometimes spawning with 50% health
FIX: Sardaukar have heavy troopers, not infantry (on LVL 4)

ADD: Capturing enemy buildings! (inc. Harvester, if unloading at the time)
NOTE: not all buildings *can* be captured, as in the original 
ADD: Units now auto-return to guard position if too far away
(less cat-herding! 😸) 
 ADD: Build "Paused" indicator (Thx Tim) 
 ADD: Flashing infantry/building when targeting
(Thx Krystian, Petr & FullThrough) 
 ADD: Sending units by clicking on Radar with left-click
(right-click for old way!)
ADD: Soldiers appear after building destruction 
ADD: Units now auto-attack nearby enemy buildings (Thx Tim + Krystian)
ADD: Building size indicator (e.g. 2x2, 3x2, 3x3, etc.)
ADD: Faction prefixes for units (e.g. Ordos Raider Trike)
ADD: Sardaukar to LVL4 (Thx Tim)
CHG: Now allows selection of partially-revealed buildings 
CHG: Death Hand now has a smoke trail
CHG: Sandworm stays around now (rather than periodically appearing)
CHG: Improved some sprites gfx (Turret bases, Carryall, Devastator, etc.)
CHG: Unit speeds have been reviewed to be closer to original game
FIX: Pathfinding performance increase (due to mem leak)
FIX: BIG render performance increase (now using TLINE + diff. shadows)
FIX: Rocket Turrets can now shoot down Ornithopters! (I know, I know...)
FIX: LVL1 End state where credits target reached but nothing happens
FIX: If has Carryall, but no Repair Facility
(it was dropping units ON buildings nearby!)
FIX: Flying units no longer affect ground-level pathfinding
FIX: Walls no longer smoke
FIX: Running over infantry was hit+miss - seems better now
FIX: Starport typo (Thx Krystian)
FIX: Placement indicator z-order (Thx Tim)
FIX: Harkonnen have no barracks (Thx Raphael)
FIX: Harkonnen  light factory can't build trikes (Thx Raphael)
FIX: Ordos have the raider, no trikes (Thx Raphael)
FIX: No faction can order Ornithopthers from the Starport (Thx Raphael)
FIX: Harkonnen have no barracks (Thx Raphael)
FIX: WOR/Trooper not available to Atreides (Thx Raphael)
FIX: Disappearing retreating units that reappear repaired
(Thx Tim + Krystian's videos)
FIX: Sandworm "eat" anim now visible when on spice dunes

ADD: Build limits on Units & Buildings (based on total count each type) to help performance & strategy
CHG: Increased repair costs - was almost free (Thx Tim) 
CHG: Lowered credit SFX vol (Thx Tim)
CHG: Performance optimisations
FIX: Crash when unable to auto-deploy unit near building (Thx Quang)
FIX: "Harkonnen" typos in mission info (Thx Tim!)
FIX: Siege/Rocket Tank details info swapped (Thx Tim + Maxwel)
FIX: IX level requirement > Lvl 7  (Thx Tim)
FIX: Heavy Vehicle Factory > req. Light Vehicle Factory (Thx Tim)
FIX: Map edge bounds for units  (Thx Tim)
FIX: Buildings not updating/destroying (Thx Krystian + Quang)
FIX: Pathfinding tweaks - hopefully better when under load (Thx spoike).

FIX: Atreides unable to build Troopers (thx all for reporting!)

Initial release

P#109394 2022-03-31 05:29 ( Edited 2023-02-06 19:37)


A sticky ‘featured game’ if I ever saw one!

P#109453 2022-03-31 06:44

@freds72 Bless you, Sir πŸ™
(+thx again for your contributions!)

P#109454 2022-03-31 06:46 ( Edited 2022-03-31 07:30)

Very nice work again!

(Thanks for the credit, I don't ever remember writing this exmaple xD)

P#109457 2022-03-31 08:32

I keep thinking I've seen the limits of the PICO-8, and then someone makes something astonishing like this. Even spread across multiple cartridges, that's some incredible work.

As a game, I found my main problem in most missions was just the unit cap, and I probably overused building turrets right up to the enemy base because turrets didn't seem to be limited. The penultimate mission did keep me on my toes with the many types of attackers from different directions.

But something has gone awry with my two attempts on the final mission. Both times I got into a state where:

  • Nothing moves, friend or foe.
  • If I try to order a unit to attack something, it will rotate to face the target, but do nothing else.
  • I'm pretty sure that's all of my Harvesters jammed into one square beneath an unmoving Carryall.
  • The second last thing I did was build a Refinery. The Harvester appeared next to it, then vanished. Possibly it's in this pile with the others.
  • The last thing I did was issue a target to my Atreides Palace. An Atreides Fremen unit has spawned in the upper left but isn't moving.
  • Buildings stopped animating for a while. Then I checked if I could still build Concrete Slabs, and built one, and they started animating again. Then I build a few more Slabs, and they stopped, apparently for good this time.

I wouldn't be surprised if I've built way more stuff than is needed to defeat this mission, but I don't think it's more than I built in previous missions. I have 8 Refineries and 16 Rocket Turrets, for example.

I hope something in here is useful in diagonsing it, and congratulations on the amount you have managed to make happen here.

P#109504 2022-04-01 10:51

Hi @Cowirrie,
Thanks for the kind words 😊

Ah... yeah - TBH, it's probably all the Turrets that did it.
They did originally count towards the unit cap, but then it seemed to limiting.
But alas, as they don't count toward the building cap either, I did leave the door open for "exploitation" πŸ˜‰

While the unit cap was a feature of the original, it's also present here for (probably) exactly the same reason... resource usage. Each unit (+turret) takes up certain CPU/mem resources. Trouble is - if that gets too high, then things get "interesting", as they all start treading on eachother's cpu/mem usage.

So, I'm afraid you'll prob have to find a different tactic to building up to enemy bases (hint: concrete slabs will do it too, and take no extra cpu/mem overhead πŸ˜‰). Then you can plonk a couple of turrets by their base and... grab some popcorn & watch what happens! 😈

If all else fails, you might want to try downloading the binary build from the UnDUNE II itch.io page. As that might run a bit faster than web version.

Good luck (+thx for playing!) πŸ˜€

P#109509 2022-04-01 12:02

Amazing work on many levels!

P#109528 2022-04-01 18:53

@Liquidream : Thank you, it was useful to know Turrets might be the problem.

In previous missions I made enthusiastic use of building Concrete up to the enemy's doorstep and placing most of my Turrets right outside their base. On this mission this seemed hard to do, so on my first attempts I built a lot more defensive Turrets while I moved my units into place.

This time. I built less excessively, attacked sooner and got a Construction Yard placed in the upper right as soon as I could. All of this was in the Web player.

Thank you again for an amazing game.

P#109548 2022-04-02 01:00

amazing work!

P#109552 2022-04-02 02:04

Congrats on completing it, @Cowirrie! πŸ₯³

...and thanks all for the kind words!
Glad ppl are enjoying playing UnDUNE II 😊

P#109568 2022-04-02 08:52

Congrats on the feature @Liquidream!

P#109676 2022-04-04 11:58

is there a way to stop your troops from retreating it gets kinda annoying but love every other part of the game

P#109786 2022-04-06 14:58 ( Edited 2022-04-06 15:03)

@Demnarwhale: No, this is by design I'm afraid
(fairly certain that was the same in the original also?)

Might be better once you have more units (Quads, Tanks, etc.) as opposed to infantry/troopers - as their retreat can be beneficial (especially if you have a Repair Facility πŸ˜‰)

Glad to hear you are enjoying it otherwise!

P#109787 2022-04-06 15:18

GOSH. There have been some incredible demakes on Pico (POOM and Alone in Pico come quickly to mind), but IMHO, this cart has gone a step even further: it's not only a technically-impressive 8-bit recreation, but genuinely addictive and playable. That's a credit to the original's pioneering gameplay, for sure, but it takes some serious black magic to recreate Dune 2's UI (and aesthetic!) with such fewer resources. I quickly found myself as engaged as I had once been with the original. The pixels must flow...

P#109902 2022-04-08 11:39

@mothgram Thank you for that wonderful (+generous!) review - hearing such kind words makes it all worth it πŸ™
You just made my day! 😊

P#109906 2022-04-08 12:22

I got further I didn't realized about repair facilities your right amazing game
something I was able to do was destroy the enemy base with defense turrets it was super fun.

P#109911 2022-04-08 15:16

Please, add the "sound test" function!
I'm not that fan to replay entire great game even in it demade glory... Yet I'd love to hear all of the musics chiptuned!

P#109915 2022-04-08 15:59

@ClockworkBastard Alas, there's 0 Tokens left for such a feature
...as cool as that would be - the sound test from Sonic 2 is one of my fav features of all time ("Aquatic Ruin" if the cart was a tape, I'd have worn a hole in it playing that!)

Now, it's not my place to say whether this is possible, but...
...it might be cool if the music maestro @Gruber (who arranged ALL the music in UnDUNE II), someday made the music available for you to listen to somehow? Maybe using the BBS music player feature, or something..? πŸ€”
(Sorry Chris, I'm not trying to throw you under the bus here πŸ˜‡)

P#109918 2022-04-08 17:10

@Liquidream @ClockworkBastard - Ideas are flowing! Let me check out that soundtrack again πŸ€”

P#110045 2022-04-11 12:16

@Gruber , oh hi!
I'm rather new to the Scene but
I already know you as a Pico-8 musician!
Here is your coves too! We'll wait some release of your.

P#110054 2022-04-11 15:49

Utterly crazy and amazing that this is done in Pico-8. Kudos!

P#111259 2022-05-03 20:06

This is absolutely my favorite pico8 game. Lost several hours to it. Wonderful work.

P#111361 2022-05-05 23:04

Thank you very much, all! 😊

(esp. from you Tom - means a lot πŸ™)

P#111373 2022-05-06 04:55

This looks amazing as ever, glad there was another update

Just a little question,
When this was released on itch.io I was pretty sure this was a multi cart.

Granted, the size of the .p8.png is 48ko here, which seems twice as big as some other carts...

But It was under the impression that it's impossible to release multicart as .p8.png, only as .p8 with accompying files or executables ?

So I am in the wrong here and how ?
Is this either not a multicart or is is possible to release multicart as .p8.png ?

P#118223 2022-09-30 17:12

@Voljegaaa Thanks.

Yup, it's a multi-cart web export on Itch.io.
However, as you say, the BBS does not support these.

So, in order to get the equivalent - I made a slightly modified build of the game which loads the separate carts (I uploaded all 12 of them, separately to my BBS profile). Then use the LOAD() function to switch between them, which the BBS does support.

For example, instead of doing LOAD("GAME_LVL2") like you would with normal multi-cart, my BBS-version of the game does a LOAD("#GAME_LVL2"), which makes the PICO-8 BBS web player auto-download and load another cart. I was already using DSET/DGET to keep track of game state - so it "just works"

(This also means that UnDUNE II can work from SPLORE, which means it can run on any device that can run PICO-8 πŸ€“)

Hopefully, this makes sense - but shout if you want anything clarified.

P#118274 2022-10-01 11:58

So if I understand this right...
This: https://www.lexaloffle.com/bbs/cposts/un/undune2-3.p8.png contains a single cart

However when executing it through the web player, other carts of the multicart will be loaded by using the load instruction

Now if I download the aforementioned cart, and execute it with the official ARM pico8 client say on my handheld, I assume this will off course not work if the handheld is not connected to the internet

Will it work if the handheld is connected to the internet though ?

P#118319 2022-10-01 20:56

runtime error line 1324 tab 0
return rnd(_g1)<1
attempt to compare string with number
in _g0 line 1324 (tab 0)
in _update60 line 555 (tab 0)
at line 0 (tab 0)

and that's using the -3.p8.png with

It happens just after the family choice and data loading.

Why scrambling the code btw? or placing no comment? Does a comment (or label) takes precious place in the cart?

P#118352 2022-10-02 05:19

@Voljegaaa Correct and yes it should do. As long as your client (web/other) has internet connection, then PICO-8 will be able to LOAD() any necessary carts on demand.

@m_b Please try updating to the latest build of PICO-8 (v0.2.5c) as there was a bug in that build that could be related.

The uploaded code is minified to bring the code size below not just the token limit, but also the compressed code size. Sadly, that means no space for comments.

P#118432 2022-10-03 14:19

Wonderful work very cool stuff

P#119240 2022-10-18 05:47

Great, but last level always got "Out of memory" error :-/

P#121849 2022-12-05 10:45

@Mirek Unfortunately, it's still possible to break (particularly on last leve). This can depend particularly on your tactics. For example, tactics like creating lots of concrete slabs and turrets up to enemy bases can eventually be too much for it to handle.
Thanks for playing - hope you still managed to have fun πŸ˜€

P#121850 2022-12-05 11:30

@Liquidream - right, if you have a lot of buildings there is a bug. If not, then you can win game :-)

P#121911 2022-12-06 13:26 ( Edited 2022-12-06 13:27)

I don't think I'd ever played an rts before but I really enjoyed this game. Ended up working on a speedrun for it and developing strategies with some others and beat it in just under 2 hours. https://youtu.be/vXWX-Z6c7Yk?t=86

P#134640 2023-09-20 11:48

@Xar Amazing - well done! πŸ‘πŸ€“
I did hear that some more people were speedrunning UnDUNE II, so it's cool that you also stopped by.
Thanks again for posting (+playing!) πŸ˜‰

P#134804 2023-09-23 16:23

Thank you for sharing your amazing work with us, and congratulations.

P#135004 2023-09-27 21:52

I hope you are fully aware you are my hero, Paul :) This is phenomenal work.
Now then, the big question is....

Can this ever be beaten?

P#135339 2023-10-03 10:49

Thank you @Roysterini - you are too kind, as always 😊

P#135413 2023-10-04 18:25

I remember playing this on the genesis for hours! It sounds and looks incredible, but I can't open the construction yard.

P#136208 2023-10-22 01:28

Hi @14A326B12K_12,
It's probably not as obvious as it should be, but you access the build menu by clicking on the top icon on the right when the Construction Yard building is selected (same for any other "factory" type of building)

Hope this helps (+thx for playing!)

P#136222 2023-10-22 08:21

dude. this is one of the greatest thing i've ever played on this website. Keep pushing the impossible.

P#140005 2024-01-11 20:46

Thank you @SoupingtonIII for the kind words.
You just made my day. ☺️

P#140007 2024-01-11 21:01

Heya! This looks insane, I never knew Pico-8 could do something like this
I got a question, though, since I don't understand the whole multicart stuff, yet: If I understand correctly, the version I can load here is just a small part of the game and the rest needs to be loaded on demand while playing. If my handheld isn't online while playing, the game will... crash?
And can I just download all 12 (?) carts of this game somewhere and just put them all in one folder and Pico-8 will know which cart to use next? (if so, does it go by file name; so I shouldn't rename them?)
Sorry, many questions :>

P#140609 2024-01-25 19:19

No worries @Ego_Bizarro - all good questions.

Yup, what you said is correct. It would rely on being online to be able to function properly.

Someone asked a similar Q a while back
...so I ended up also adding the full 12-cart version as a download on my Itch game page, which should run without needing to be online.

Hope that makes it easier for playing & enjoy πŸ˜‰

P#140610 2024-01-25 19:31

[Please log in to post a comment]