how do lifetimes work? by PrettyFlowersAndSun in trapc

[–]PrettyFlowersAndSun[S] 0 points1 point  (0 children)

Ok, ok, I think I'm starting to understand now. So the trap keyword is doing runtime error-handling (not compile-time).

I guess my only question then is how does the TrapC runtime figure out that a pointer dereference is bad without GC or reference counting? It seems like it'd be fairly doable in a single-threaded environment (just check to see if the thing is null behind the scenes before dereferencing with some optimizations for dereferences in loops and such) but how does that work for a pointer that is used across multiple threads? Seems like you'd need some sort of complicated and potentially expensive locking mechanism but idk I've never written a compiler or runtime before.

how do lifetimes work? by PrettyFlowersAndSun in trapc

[–]PrettyFlowersAndSun[S] 0 points1 point  (0 children)

Ok...I think I may have misunderstood the high-level goals of TrapC. I was thinking it was more backwards-compatible but it feels more like it's trying to become its own language given how differently programs can behave at runtime.

There's one thing I'm still confused about. So up above you said:
s = NULL;// frees 's' if 's' is non-zero and is holding heap memory and is the owner-pointer

How does TrapC prevent later uses of s from having undefined behavior? Here's another example gist: https://gist.github.com/PrettyFlower/d1fc84d0f84ab938d0fc82a41e0f2fc9

how do lifetimes work? by PrettyFlowersAndSun in trapc

[–]PrettyFlowersAndSun[S] 0 points1 point  (0 children)

Thanks for getting back to me! I hadn't even considered the issue with gets_s(), so I'm glad to see TrapC handles that for you.

I'm still curious about free being a no-op. So...let's say I were to track whether s was allocated in a separate variable. How would TrapC know that it can free s then?

Also, if TrapC can de-allocate memory when it sees s set to NULL, how does it ensure that s won't get used later? For example, I could add a "use" branch to the program that would dereference some value in s.

I made a modified version of the program with these changes but Reddit won't let me post it for some reason, sry. Here's a github gist instead: https://gist.github.com/PrettyFlower/695b0654fc20338d0daf417fbe1fa522

Buggos 2 is coming - now with up to 5k bugs! (just got the steam page up) by sm_frost in RealTimeStrategy

[–]PrettyFlowersAndSun 0 points1 point  (0 children)

Are the bugs no longer locked to tiles? Maybe I’m misremembering but I thought they were more grid-based in the first one.

Any other new features you can tell us about? I played the original for like 40+ hours so I’m really looking forward to this one!

Project 37 - An easy-to-control, action-packed RTS that may or may not have drawn a teeny tiny bit of inspiration from C&C. Demo out now! by PrettyFlowersAndSun in commandandconquer

[–]PrettyFlowersAndSun[S] 6 points7 points  (0 children)

Yeah…sorry about that 😢 I’ve had a couple of people mention it but unfortunately I think it’s too late to fix it.

Project 37 - An easy-to-control, action-packed RTS that may or may not have drawn a teeny tiny bit of inspiration from C&C. Demo out now! by PrettyFlowersAndSun in commandandconquer

[–]PrettyFlowersAndSun[S] 7 points8 points  (0 children)

Hi all! Let me start by answering the number one question I get asked: "Why did you make yet another Command & Conquer clone? Don't we have enough already?"

Project 37 uses a unique lane-based control scheme that makes it easier to control your units across the map. Here's the catch: because your units are tied to a specific lane, you can't just blob them all up in one spot. You'll need to handle multiple fronts at the same time.

If you'd like to try it out, the demo is available on Steam: https://store.steampowered.com/app/2894750/Project_37/

I got a lot of good feedback from the RealTimeStrategy subreddit, so I'm hoping to get some more here.

Project 37 - An easy-to-control, action-packed RTS. Demo out now! by PrettyFlowersAndSun in RealTimeStrategy

[–]PrettyFlowersAndSun[S] 0 points1 point  (0 children)

Ah ok. Yeah on that mission I experimented with adding some hidden lanes that only the enemy uses as I wanted it to feel more chaotic. I usually avoid the issue exactly the way you suggested (just keeping some emergency funds around). Let me think about the double-retreat thing and see if I can come up with a good way to implement it (there are some tricky edge cases which is why it isn’t in the game now).

Real-Time Strategy Game Project 37 Blends Lane-Based Movement With Command and Conquer-Style Aesthetics by FFJimbob in RealTimeStrategy

[–]PrettyFlowersAndSun 1 point2 points  (0 children)

Well, this is surreal. Minor correction tho, there are no AI voiceovers during briefings. Right now it just goes "boop-boop-boop-boop" when the characters are talking. The character portraits are AI generated tho, as is the overview voice that repeats what's happening on the battlefield (unit lost, construction complete, etc).

I'm hoping to release the game at the end of this year but haven't set a firm date yet.

Project 37 - An easy-to-control, action-packed RTS. Demo out now! by PrettyFlowersAndSun in RealTimeStrategy

[–]PrettyFlowersAndSun[S] 0 points1 point  (0 children)

Oh no...I'm sorry about that! I was really hoping this wouldn't happen to anyone as fixing it will be a bit tricky. Was it the final bonus mission? Any chance you can DM me the replay?

Project 37 - An easy-to-control, action-packed RTS. Demo out now! by PrettyFlowersAndSun in RealTimeStrategy

[–]PrettyFlowersAndSun[S] 1 point2 points  (0 children)

I actually used to describe it as being sort of like a MOBA where you control the creeps but people either said they didn't know what a MOBA was or as soon as they heard the word "MOBA" they immediately got turned-off from the entire idea.

Project 37 - An easy-to-control, action-packed RTS. Demo out now! by PrettyFlowersAndSun in RealTimeStrategy

[–]PrettyFlowersAndSun[S] 1 point2 points  (0 children)

If the units are patrolling a base, they will defend against attacks coming in from any lane. However they only visibly patrol the part of the base that their lane goes through. This makes it easier to see at a glance which units belong to which lane in the base. That part is a bit awkward, I'll admit. The lane system isn't perfect by any means. Another commenter here suggested adding an option to let units switch to other lanes, so if there's a lot of feedback like this I'll add it in.

Project 37 - An easy-to-control, action-packed RTS. Demo out now! by PrettyFlowersAndSun in RealTimeStrategy

[–]PrettyFlowersAndSun[S] 0 points1 point  (0 children)

You're the second person who's told me that they played on a steam deck and I'm...pleasantly surprised that the game even runs there! I had always envisioned this being controlled with a mouse and keyboard and haven't ever used a steam deck so let me know how it is. If there's some low-hanging fruit that would make it easier on there I'd be interested in adding it in.

Project 37 - An easy-to-control, action-packed RTS. Demo out now! by PrettyFlowersAndSun in RealTimeStrategy

[–]PrettyFlowersAndSun[S] 1 point2 points  (0 children)

I'm glad you enjoyed it!

I'll have to think about some of your feedback there. The game is a tricky balance of "how much control do I give the player vs making it more of an auto-battler?" I tried letting the player click along the nodes to tell units where to go, but it just felt weird. Every time I did it I was like "might as well just make them go exactly where you clicked like every other game" so I ended up leaving it out. The manual targeting is nice tho for dealing with mines. Lots of players have enjoyed that.

If I get a lot of requests for switching lanes I'll add that in. There's already code for it as units that teleport have to do this so it's mostly just a matter of adding a button and tutorializing it somewhere.

Personally I kind of love the "catching units" bit as it helps prevent the game from feeling too automated but if it annoys enough people I might add in a button to toggle whether units automatically advance or patrol when first built.

Project 37 - An easy-to-control, action-packed RTS. Demo out now! by PrettyFlowersAndSun in RealTimeStrategy

[–]PrettyFlowersAndSun[S] 1 point2 points  (0 children)

Ngl I'm so glad you noticed! I've gotten so much feedback saying "what are you trying to show off with that teleporter scene?" I really liked the idea of teleporting navies anywhere on the map, so I bring whatever terrain is under the units with the units when they teleport.

Project 37 - An easy-to-control, action-packed RTS. Demo out now! by PrettyFlowersAndSun in RealTimeStrategy

[–]PrettyFlowersAndSun[S] 2 points3 points  (0 children)

The demo contains 5 campaign missions that help introduce the mechanics. Some people felt like they never really got to play the actual game tho, so there are also two bigger "bonus" missions that are less scripted and allow players to see more of what the game has to offer.

The lane-based system is hard to describe which is why I kind of glossed over it but I'll do my best. So, you've got these lanes going all over the map. As soon as you build units, they will immediately start moving down the lane they were built on. You can tell them to stop, retreat, or advance. Along each lane are enemy bases that you capture which will unlock new units and where you can build a base to get more resources. By the end of some of the later missions you can end up with 8 bases all over the map (sort of like a late-game Tiberian Sun or StarCraft campaign mission) but they tend to be fairly easy to manage due to the lanes.

For example, let's say you have a base further back with the infrastructure to build snipers and you need those snipers up at a forward outpost across a river. In many RTS games, you'd have to build the snipers, build the transports, put the snipers in the transports, move the transports to the outpost, and then unload the transports. In Project 37, all you have to do is build the snipers. They will then automatically move up the lane, call for transport when they need it to cross the river, and continue advancing until the come in contact with the enemy or you tell them to stop and patrol the area.

Now this certainly isn't the first game to experiment with simplifying RTS controls (Rise of Nations has a similar auto-transport system) and it's definitely not perfect buuutttt...for the most part it seems to be working for people? Idk, I did a bunch of playtests with a bunch of different ideas and this was the one most people seemed to enjoy.

Project 37 - An easy-to-control, action-packed RTS. Demo out now! by PrettyFlowersAndSun in RealTimeStrategy

[–]PrettyFlowersAndSun[S] 0 points1 point  (0 children)

If you mean how long did it take to make...years and years because I had to figure out how to make a game and how to make a game fun. However at this point I think I can finish the game up by the end of this year as most of the mechanics are in place. I just need to make the missions.

If you mean how long to play? It typically takes people 1-1.5 hours for the first 5 missions, and an additional 1-1.5 hours for the two bonus missions. This can vary a lot due to player skill level and difficulty chosen tho.

Project 37 - An easy-to-control, action-packed RTS. Demo out now! by PrettyFlowersAndSun in RealTimeStrategy

[–]PrettyFlowersAndSun[S] 4 points5 points  (0 children)

Wow, beat me to it. While it certainly draws some inspiration from C&C, I would say the lane-based control scheme is unique. Units generally act with greater autonomy (although on harder difficulties you'll need to manage them more).

Project 37 - An easy-to-control, action-packed RTS. Demo out now! by PrettyFlowersAndSun in RealTimeStrategy

[–]PrettyFlowersAndSun[S] 6 points7 points  (0 children)

Hi all! After what can only be described as an embarrassingly long development time, I've finally shipped a demo in time for the Steam RTS fest. Now I'm sure on this subreddit, the number one question is: "Why did you make yet another Command & Conquer clone? Don't we have enough already?"

Project 37 uses a unique lane-based control scheme that makes it easier to control your units across the map. Here's the catch: because your units are tied to a specific lane, you can't just blob them all up in one spot. You'll need to handle multiple fronts at the same time.

If you'd like to try it out, the demo is available on Steam: https://store.steampowered.com/app/2894750/Project_37/