The Dink Network

2 hero control scheme

January 20th 2008, 08:30 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
If anyone remembers, awhile back I was working on making Dink two players. A little while later I quit that since it wouldn't control the way I wanted it to (Erwin took that up I haven't heard any progress from that in awhile.) Off of that thought I came up with a new kind of "2 player" game.

In this game mode one player controls 2 heroes. Lets name them Dink and Rick. But how does one control two heroes at the same time? Well obviously that would be too hard to play, so one of the players will be controlled by an npc brain. So here's how it works. You start out as Dink, but you can switch in-between characters by pressing "]" (temporary key.)

The whole idea behind this was that each character has specialty skills that require you to switch often. Well, that and the npc is stupid so you have to save his tail by switching to him and pulling him out of the heat. You can tell because he is using the health bar by magicman. If one of your heroes die then it's game over, so this is crucial.

Both characters will have their own weapons and spells. They will also have their own stats. Experience is the only exception. In this case you will have a choice menu for both characters.

I've completed the basics for the most part:

:: When you change the screen your friend will follow you and retain his health always.

:: The level-up script works perfectly updating the npc stats and the player's right away. Also, Dink getting exp for npc kills works.

:: The death script kills off both players (as well as the npc's death procedure.)

:: Switching characters is smooth and visible and inventory swapping works.

:: The healthbar works and is fixed to show a change in max health.

:: Npc moves from target to target smoothly even when the player steals a kill.

:: Saving/Loading works. You always start a game as Dink.

Some things that are planned for the future:

:: Npc spells and cast delay.

:: Smarter npc that knows when to run away?

:: Npc commands. Such as telling the npc to cast a spell or target a certain type of foe (ranged or melee)

:: Npc grabbing power-ups when he needs them?

:: Power-ups that raise stats of both players?

If anyone has anymore ideas I may try them, but I have my hands full with that. And if anyone is wondering.. This has nothing to do with my current Dmod. If anything, it's a result of procrastination

I may release it soon, possibly as is, but then again maybe not If anyone wants to help or implement an idea of their own I could send it to them. I only ask that you let me know what you want to do with it and let me know if your 'fix' causes any bugs.
January 21st 2008, 01:45 AM
spike.gif
Tolang
Peasant He/Him United States
I would say something, but it wont fit. 
i think the power-ups should power-up both players
January 21st 2008, 03:58 AM
anon.gif
no spambot
Ghost They/Them
 
Sounds very interesting. Looking forward to the release.
January 21st 2008, 04:29 AM
wizardb.gif
Endy
Peasant He/Him United States
 
What about healing potions/spells that the player can give to the npc or work via a key press?

Could just set a missile brain to follow the npc around, sensing whenever the npc is over a power up. Either going to have to do a search for them or keep track of their spawn positions though.

Did you manage to get the bow to work properly for when Dink isn't player controlled? I was trying to upgrade Dink's Double and couldn't get it to work properly.
January 21st 2008, 08:08 AM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
Power-ups are only going to be able to be picked up by the player. Unless I do the thing where the npc grabs hearts when he's low on health. This will allow total controllability of what player gets what item. If there is a strength potion, the player decides which hero needs it most and then picks it up with that character. It'll add more strategy.

I haven't done the potions thing yet. It sounds like a good idea. I had intended for the player to switch and give the other character a potion, but I'll add in a script for that as well. There were also plans for Rick (Dink's friend) to have healing magic. He would obviously cast this when someone needs it if he has the magic for it.

No bow yet. That'll come in with the npc commands (hopefully.) If I added that, he would probably just shoot without charging up, so it would kinda pointless considering that it would act like a fireball (which he will have at the least.)

I've included touch damage scripts for enemies (ones that will hurt the npc.) I don't know if anyone would use them since the npc doesn't pay attention to when he's being hurt, therefore absorbing it all and dying quickly.

I've added a script that displays the stats of the npc (name, strength, defense, and magic included.) It appears to slow down the game though so that of course is easy to remove by removing a spawn("script") line in start1.c and savebot.c. I think I'm going to make a tiny little choice menu stat displayer as an alternative. Both of these will be included.

Is anyone good with making npcs be smart? Such as avoiding touch damage, not getting stuck on sprites/hardness trying to get to a target/ etc.. I could use help in those areas. And possibly a better shoot script
January 21st 2008, 06:08 PM
sob_scorpb.gif
Hades
Peasant He/Him Australia
Remember you're unique, just like everyone else. 
Maybe you could have a direct follow command where the npc follows you directly and on the same pixels that you went across, this would potentially be a problem if you were avoiding moving traps or monsters but you could always turn it off as well.
January 21st 2008, 06:20 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
That could be another command key. I could do that I think. The simplest way would to use the sp_follow() command. Or I could make a standstill function so the player has to carry them both over manually, but the npc won't goof of while in-between moving characters. Or just make both commands

I guess I should also make icons to put somewhere to show what commands are in effect.
January 21st 2008, 06:32 PM
fairy.gif
Someone
Peasant He/Him Australia
 
I did some work on a smart navigation script a while ago. It successfully scans the landscape and modifies its trajectory to avoid contact with objects. It's one of the creepiest things I've ever seen and I have to use all my strength just not to hide behind my chair whenever I see it. ("It's alive!! ALIVE!!")

Unfortunately though it only works with white hardness (though there might be some way around that) and more problematic, requires about 20k of script to be executed every second or so... Navigating in an intelligent way is really not as easy thing to program, especially when you don't have access to the basic code (as you don't in DinkC).

It could have some uses though. My thoughts were to have a brain 9 enemy that regularly checks if it has a direct line-of-sight to its target and only when it's broken is the navigation activated to override brain 9 movement, then reactivates brain 9 when the direct LOS is true.

I also tried a simpler rule to enable a sprite to navigate an infinitely complicated maze (the never failing hug the left wall trick) but that doesn't work as well as I wanted it to, though sprites can get a bit into the maze.

However getting a sprite to avoid WHITE hardness is pretty easy if you don't care how intelligent the sprite looks to go about it. Blue hardness is harder because it doesn't trigger damage() or destroy missiles (even if sp_flying is 0).

I'm not sure what you mean by shoot script but the best enemy/npc missile shoot script is my one in MouseDink, except it doesn't have any prediction.

Also about 2 players in general, I sent Erwin some code but I haven't heard from him in a month or so. I'm convinced it's possible to produce a 2nd player that can be played at the same time and is identical to Dink except:
a) he will move marginally slower
b) no diagonal movements
c) slight lag between releasing a key and the player stopping (perhaps around 250-400ms)

With an external program that the user must run before Dink.exe, b can be fixed and c decreased.

So if you are only doing it this way because you think the other way is impossible, well, it's not!

The bow would be easy to program for both the NPC and player-controlled "NPC". I don't know what you would have problems with.

Avoiding touch damage is also a simple task. What brain are you using for the NPC? 9? And what modes of attack? How aggressive? An NPC that avoids all enemies and shoots missiles (or produces explosions at certain locations -- even easier) would require very different AI to an NPC that spars with the sword.
January 21st 2008, 09:47 PM
slayer.gif
rabidwolf9
Peasant He/Him United States
twitch.tv/rabidwolf9 
As or now the npc functions only as melee with nothing other than brain 9, sp_target() and set_smooth_follow(). There is nothing special so far. When I implement a ranged mode (you toggle inbetween ranged and melee by pressing a key) he may end up with a new script altogether for that particular mode.

I'm not quite sure how to go about making the npc "run away." I'd need some actual code in that area. I'm quite dumb when it comes to programming actual behavior of AI. The only real reason I can manage making an npc shoot is because the scripts are already out there.
January 25th 2008, 09:40 PM
spike.gif
Tolang
Peasant He/Him United States
I would say something, but it wont fit. 
Man this D-MOD sounds AWSOME. I can't wait.
January 25th 2008, 10:29 PM
knights.gif
Bud, its not a d-mod, its a Dev file.
January 26th 2008, 08:26 PM
sob_scorpy.gif
DinkDude95
Peasant He/Him Australia
The guy with the cute D-Mod. 
Really? Woah! I never would have guessed! >_>
January 27th 2008, 08:21 AM
slimeb.gif
DaVince
Peasant He/Him Netherlands
Olde Time Dinkere 
Tolang wouldn't, and he was obviously replying to him.
February 1st 2008, 05:08 AM
wizardb.gif
Endy
Peasant He/Him United States
 
Could do a search of the field for an area an enemy isn't in and create a fake sprite there for the Npc to target. You could also just have him retreat to where Dink is or where he entered the map at.

Haven't actually tried it but it should be possible to shoot off a super fast fake invisible missile to sense the terrain ahead. If you check the x/y co-ordinates directly every so often, you could tell if the missile is stoped for some reason.

I was kind of toying with the idea that the Knight's thick armor protected him from touch damage. Not a great explaination, but it kinda works

February 1st 2008, 06:12 PM
burntree.gif
fireball5
Peasant He/Him Australia
Let me heat that up for you... 
hmm... your fake missile idea gave me ideas... and not just in dink. i am making an AI for a network-compatible game