ID:84190
 
Keywords: design
Once again, the gears have started to turn, my fingers come in touch with the keyboard and on the other side is BYOND Dream Maker indiscriminately recording my deluge of mistakes. I've picked up my old Vehicle Wars project and decided to work on turning it into a game.

Instead of having 3 controllable factions, I'm now working on simply having one faction: our Terrans, who have arrived on a planet to turn it into a colony. Behold the power of the Keep It Simple, Stupid principal, as everything comes together beautifully at that point: the existing Native AI works excellently as an opposing force of wild, unsophisticated creatures, and the Terrans already have the mechanics in place to build whatever they're told to build. I was much closer to a finished (if not complicated or refined) game than I thought.



Unfortunately, I've run into an immediate hitch: I need to bring the player's commands into the game where the existing code already is, and that's proving quite a mind bender (especially after a two month vacation from hard development).

Here I thought before I was developing an advanced artificial intelligence because I was distracted with it as a bit of an experiment. Now, I think perhaps I was doing it because I was taking the path of least resistance. It seems I've still a rather important thing to learn about BYOND, and that is how to create a really good control scheme.

In this entry you'll see where I was: I had hotkeys, I was trying to manipulate things through objects that were placed in the contents of things, and decided against it because it's very obj bloaty and technically I already have verbs to do that.

What I need to do now (instead of blog about doing it) is get really comfortable with verbs, to the point where I can take a verb list and create those hotkey banks from them. The goal is for the players to simply click on a hotkey, then double click on the map, and the appropriate verb activates there.

It's beginning to look like what I might need to make a compromise instead, because I don't think BYOND's verb functionality was really built to do that. The access control would probably tear apart any attempts to access them by proxy in this manner.

So, what will be my final solution? Perhaps ditch this idea of there being a bank of 12 hotkeys and simply create one scrollable list of currently available verbs. Perhaps simply use the native right-click verb functionality, put the verbs on the turfs as accessible by all players and control access via verb arithmetic. I've gotten rid of the stat panel, my point-and-click interface makes things very easy on the players, but not so easy on me.
You should include more pictures. I have no idea what you're talking about most of the time, but I find including pictures to help explain things make it much easier to comprehend. :)
Well, although BYOND's screenshot functionality cuts out anything that's not on the map right now, I might be able to cobble together a screenshot if I use the Windows screenshot functionality.

However, I don't want to do so on the grounds that what I have right now is very rough. I would be generating a false impression to publish a picture of a rough GUI I have no intention to use.

The important thing at this point is really more conceptual. I have 12 grid elements which are 34x34 so they can each display a single object. Each object corresponds to some function in the game. The intention is that the player would be able to click in a grid element to make its contents the active function, then double-click somewhere on the map to make that function happen there.
I didn't say include screenshots, I said include pictures. Illustrations, examples, anything to prevent your posts from being just a wall of text.
Ah, I see. I'll see what I can do.
Viola - hows that, too crude or just right?
Needs a little formatting (center!), but other than that its not bad. Better than nothing at least. :P
I'm glad to see you back at it.

I'd wonder why your verbs/hotkeys are so complicated?

By hotkey, are you talking about providing users with a way to add 1-n buttons which activate a user defined command of some kind?

ts
Not even that complicated. More like having game functions show up on a grid control that can be swapped between multiple functions as required by the game design.

My main trouble is I want to do it efficiently. I used to have a system that actually put function objects on every controllable mob in the game, but I realized I'd soon hit the object cap if I went that route.

Right now, I'm thinking I'll be okay if I keep the function objects only on the individual player mobs being directly associated with the clients.
heh. I still don't follow.

Is the solution this simple?
1. Click a button in the UI.
2. Click somewhere on the map to have the action associated with that button applied?

If so, is the problem that you have way more "actions" than button space?

ts
Tsfreaks wrote:
heh. I still don't follow.

Is the solution this simple?
1. Click a button in the UI.
2. Click somewhere on the map to have the action associated with that button applied?

Yes, pretty much.

If so, is the problem that you have way more "actions" than button space?

Yes, I expect the player will come into contact with a fairly diverse unit variety, and not all actions will be available at all times, and so 12 buttons isn't going to cut it.

It is a little more complicated because I want to do it efficiently, without excessive object bloat.

It's not really a conceptual problem so much as it is a platform comprehension problem. I've been wrapping my head around how to go about doing this in BYOND.
Well... your posting as if you need help but you seem to resist it... but I'll give it anyway. :)

My previous solution was not what you needed and was in fact backwards from your requirements.

Seems easy enough though.
1. Select any unit.

2. The click event determines the unit type clicked and you assign it to the mobs selectedUnitObj var. If you allow multi-select, add them to a list and account for that later.

3. You spawn off a function which will winclone all the appropriate buttons (actions)for that unit.

4. When the buttons are created, they essentially draw from a list of commands.

List (text)
Attack
Defend
Retreat

As you WinClone the buttons, you provide these actions as the argument back into a single verb

verb/UnitCommand(var/t as text)

When the call comes in here, you run it through a switch

switch(t)
if("Attack")
// If it's a list of selected mobs, loop
selectedUnitObj.Attack()

if("Defend")
if("Retreat")

If this is a multipart action (Click again to attack), then you simply redirect the next "click" action to the currently selected mob. If they have an action assigned, perform it, otherwise, prep it.

The key part being how you can dynamically create your action buttons.

ts
Sorry - not trying to resist help so much as I know it's kinda simple and feel a bit embarrassed asking. ;)

WinClone, eh? I never used that function before. Sounds like something I should learn. Putting it on the very skin level like that, as an actual button control, might be just what I was lacking.
Geldonyetich wrote:
Sorry - not trying to resist help so much as I know it's kinda simple and feel a bit embarrassed asking. ;)

WinClone, eh? I never used that function before. Sounds like something I should learn. Putting it on the very skin level like that, as an actual button control, might be just what I was lacking.

Oh yea. The interface kicks mucho ass once you figure out all the cool tricks.

Ping me directly if you run into any trouble at all. More than happy to pass along what I've learned.

ts
I'd be tempted to use a grid of pictures instead of actual buttons. Each picture would be a topic link for a datum (which you should have plenty of). When space runs out, you just scroll down.
That's sort of what I was thinking what I had grids of objects too - it'd be better to have a graphical representation. However, a button can have an image file on it, so it's a viable alternative.

Even more deliberation on whether or not I want to lose that handy Grid object functionality. You can do neat things like right click them to pull up a verb menu or drag and drop them with grid controls.

Seems it's the excess of choice that is the most paralyzing to me. ;)
Seems it's the excess of choice that is the most paralyzing to me. ;)

Really, I think this is sort of what I'm trying to say here in this Blog entry. The technical details are tough, yes, but the bigger problem is more along the lines of what kind of functionality I really am going to need, how to pull it off efficiently, ect.

I guess all I can really do at this point is forge onward and be ready to uproot and recode as needed.