• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 21:27
CEST 03:27
KST 10:27
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Code S RO8 Preview: herO, Zoun, Bunny, Classic7Code S RO8 Preview: Rogue, GuMiho, Solar, Maru3BGE Stara Zagora 2025: Info & Preview27Code S RO12 Preview: GuMiho, Bunny, SHIN, ByuN3The Memories We Share - Facing the Final(?) GSL47
Community News
Code S RO8 Results + RO4 Bracket (2025 Season 2)2BGE Stara Zagora 2025 - Replay Pack2Weekly Cups (June 2-8): herO doubles down1[BSL20] ProLeague: Bracket Stage & Dates9GSL Ro4 and Finals moved to Sunday June 15th13
StarCraft 2
General
flash bitcoin software Jim claims he and Firefly were involved in match-fixing Code S RO8 Results + RO4 Bracket (2025 Season 2) The SCII GOAT: A statistical Evaluation Code S RO8 Preview: herO, Zoun, Bunny, Classic
Tourneys
[GSL 2025] Code S: Season 2 - Ro8 - Group A [GSL 2025] Code S: Season 2 - Ro8 - Group B RSL: Revival, a new crowdfunded tournament series SOOPer7s Showmatches 2025 Sparkling Tuna Cup - Weekly Open Tournament
Strategy
[G] Darkgrid Layout Simple Questions Simple Answers [G] PvT Cheese: 13 Gate Proxy Robo
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 477 Slow and Steady Mutation # 476 Charnel House Mutation # 475 Hard Target Mutation # 474 Futile Resistance
Brood War
General
BW General Discussion BGH auto balance -> http://bghmmr.eu/ FlaSh Witnesses SCV Pull Off the Impossible vs Shu StarCraft & BroodWar Campaign Speedrun Quest Will foreigners ever be able to challenge Koreans?
Tourneys
[BSL20] ProLeague Bracket Stage - Day 4 [BSL20] ProLeague Bracket Stage - Day 3 [Megathread] Daily Proleagues [ASL19] Grand Finals
Strategy
I am doing this better than progamers do. [G] How to get started on ladder as a new Z player
Other Games
General Games
Stormgate/Frost Giant Megathread Path of Exile Nintendo Switch Thread Beyond All Reason What do you want from future RTS games?
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Who’s Getting the Effortless-Chic Look Just Right?
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread UK Politics Mega-thread Russo-Ukrainian War Thread Vape Nation Thread
Fan Clubs
Maru Fan Club Serral Fan Club
Media & Entertainment
Korean Music Discussion [Manga] One Piece
Sports
TeamLiquid Health and Fitness Initiative For 2023 2024 - 2025 Football Thread Formula 1 Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
A Better Routine For Progame…
TrAiDoS
StarCraft improvement
iopq
Heero Yuy & the Tax…
KrillinFromwales
I was completely wrong ab…
jameswatts
Need Your Help/Advice
Glider
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 18416 users

Student Game Dev Part 13 - Context menu + enemies

Blogs > Soan
Post a Reply
Soan
Profile Blog Joined August 2010
New Zealand194 Posts
February 21 2014 02:08 GMT
#1
+ Show Spoiler [Previous parts] +
Part One - It begins
Part Two - Technical Foundation
Part Three - Game Design
Part Four - Input and Physics
Part Five - More Physics Things
Part Six - Even More Physics
Part Seven - User Interface
Part Eight - UI and the Editor
Part Nine - Editor Progress
Part Ten - Progress, and videos
Part Eleven - Fixing the Physics
Part Twelve - Unproductive


This Week
Hello again TeamLiquid! Welcome back to my blog about the development of The Adventures of Sam the Pirate, the 2D platformer I'm creating as the final game project for my Bachelor of Software Engineering degree. Last week I talked about creating the context menu, this week I'll be talking about further work on that, and the work I've done on the editor. Saw a few pencil sketches of character concept art from an artist earlier in the week as well, and I liked what he'd done, so with any luck I will have some character art to show off relatively soonish.

Editor Progress
Context menus now feature buttons, all added and removed dynamically, rather than having to edit code every time I want to change it. Right now, the only functionality in the menu is buttons, but given that I've only got about 12 weeks left, that's probably how it will stay. I would like to add other elements, like drop down, check boxes, etc, but that'll possibly be something for the future after I graduate.

Each context menu is created from an initialization file, containing information on what buttons are there, all the related art, heights of the buttons, width of the menu etc. The height is automatically worked out based on the combined height of all the buttons. The display order of the buttons is done by the order they are created in, so if I want to change the order they're displayed in, I just change the order of creation. When I create other elements that can be added to a context menu, I'll probably have to change how this is done. I'll likely just add a sorting value or something to each object, so they can be sorted in order from highest to lowest, or vice versa.

The editor can now also remove existing tiles, which was something I probably should have done just after being able to add tiles, but never got around to implementing it. The next step is to be able to alter the players start position in the level, which is currently hard coded. This will be relatively simple, and I might work on it after I finish writing this blog post!

Basic Enemies
Part of my work in the editor this week was being able to place the basic zombie pirate enemy, which I can now do. They get saved out to file with the rest of the levels information, and are being loaded into the game in the correct positions. They don't do anything, and are using the same temporary art as seen in this video, so I don't have any videos or screenshots this week! Maybe next week I'll have a new editor video to show the context menu and placing enemies etc.

The current plan for the basic enemy in game, is for it to just walk back and forth. They'll be checking the next grid square in front of them to see if there's anything there, either by using a ray cast, or directly checking that position, and if there is, they'll turn around and walk the other direction until they hit a wall or ledge. As for killing the player when they are nearby, I've got a couple thoughts on how to detect that.

One option, is for the zombie pirates bounding box to be wider than necessary. Then when the player enters that area, it is shrunk to a smaller size, the zombie pirate start attacking, and then I do collision detection from there. The other option I'm thinking of involves checking in a radius around the enemy for the player, and if found, start attacking. It's the same end result, but the first one seems like it might be slightly more efficient, as it's making use of existing physics code, whereas the second option requires adding extra code to the zombie pirate to scan the area around it.

One other consideration for player/enemy interaction, is what if they're both attacking? Which one takes priority? Enemies will probably always be attacking if the player is in range, so perhaps the player should take priority and kill the zombie pirate. Unless of course, enemies have a delay between attacks, and the player can only kill them during that delay. I think I like the second option better, as it could make killing enemies slightly more about skill. Instead of just mashing the attack button as you run through zombie pirates, you have to time it for the delay between their attacks.

I also need to think about whether or not the zombie pirates should follow the player when they are close, or simply walk their paths and attack when the player is in the way. During our Artificial Intelligence player we wrote the AI for a game, where the AI units could detect the player and chase them until they player went out of range. I think it would be interesting to implement something similar here. Give all enemy units a sight range, and have them chase the player for as long as the player is in sight range. The grid nature of each level means I could use a path finding algorithm such as Djikstras or A* so that they can jump up and down platforms, before finding their way back to their area. It's probably a bit much to implement before I graduate in May, so I'll probably stick to something simple and just have them go back and forth, but I think I'll definitely look into chasing and path finding for enemies in the future.

What's next?
Over the next week I'll be implementing enemy functionality, their movement and interaction with the human player. I also need to look at some of the in game menu stuff, as currently there's no way to get back from the game to the title screen in order to start a new game, which is functionality I'll probably need in order to conduct play testing in a couple of weeks. I'll also be poking my artists to see what they've come up with and hopefully have some new pretty pictures to show.

Keep up to date!
Be sure to follow me on Twitter, and like the Facebook page to stay up to date on future content and blog posts when they happen. If you have any questions don't hesitate to ask, either through Twitter or Facebook! You can also check out the blog, previous posts, screenshots and videos over at my site.

*****
WarSame
Profile Blog Joined February 2010
Canada1950 Posts
February 21 2014 07:46 GMT
#2
Thanks for these posts.
Can it be I stayed away too long? Did you miss these rhymes while I was gone?
Please log in or register to reply.
Live Events Refresh
OSC
00:00
OSC Elite Rising Star #15
LunaSea vs BabymarineLIVE!
Mixu vs Moja
ArT vs INexorable
HiGhDrA vs Shameless
TBD vs ArT
xJustxJordanx1
Liquipedia
Replay Cast
00:00
uThermal 2v2 Circuit: May
CranKy Ducklings76
Liquipedia
OSC
21:00
Mid Season Playoffs
ArT vs ReBellioN
HonMonO vs Ziomek
Shameless vs LunaSea
MilkiCow vs GgMaChine
Moja vs HiGhDrA
Jumy vs TBD
Demi vs NightPhoenix
Solar vs Cham
SteadfastSC111
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft334
RuFF_SC2 146
SteadfastSC111
ROOTCatZ 64
StarCraft: Brood War
Sea 3116
Artosis 771
Sharp 93
Icarus 8
Dota 2
monkeys_forever337
LuMiX1
Counter-Strike
Stewie2K621
taco 538
Other Games
summit1g11172
tarik_tv6260
C9.Mang02574
shahzam1225
ViBE259
ToD125
UpATreeSC74
Organizations
Dota 2
PGL Dota 2 - Main Stream5652
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Berry_CruncH270
• Hupsaiya 48
• davetesta28
• HeavenSC 15
• sooper7s
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• RayReign 6
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
League of Legends
• Doublelift6245
Other Games
• Scarra1177
Upcoming Events
WardiTV Invitational
9h 33m
HiGhDrA vs Nicoract
MaNa vs HiGhDrA
HiGhDrA vs Reynor
Nicoract vs Reynor
MaNa vs Nicoract
MaNa vs Reynor
MaxPax vs Spirit
Krystianer vs Spirit
OSC
11h 33m
BSL 2v2 ProLeague S3
17h 33m
Korean StarCraft League
1d 1h
SOOP
1d 7h
sOs vs Percival
CranKy Ducklings
1d 8h
WardiTV Invitational
1d 9h
Cheesadelphia
1d 13h
CSO Cup
1d 15h
BSL: ProLeague
1d 16h
Hawk vs UltrA
Sziky vs spx
TerrOr vs JDConan
[ Show More ]
GSL Code S
2 days
Rogue vs herO
Classic vs GuMiho
Sparkling Tuna Cup
2 days
BSL: ProLeague
2 days
Bonyth vs Dewalt
Cross vs Doodle
MadiNho vs Dragon
Replay Cast
2 days
Wardi Open
3 days
Replay Cast
3 days
Replay Cast
4 days
RSL Revival
4 days
Cure vs Percival
ByuN vs Spirit
RSL Revival
5 days
herO vs sOs
Zoun vs Clem
Replay Cast
5 days
The PondCast
6 days
RSL Revival
6 days
Serral vs SHIN
Solar vs Cham
Replay Cast
6 days
Liquipedia Results

Completed

CSL Season 17: Qualifier 2
BGE Stara Zagora 2025
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
KCM Race Survival 2025 Season 2
NPSL S3
Rose Open S1
CSL 17: 2025 SUMMER
2025 GSL S2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025
YaLLa Compass Qatar 2025
PGL Bucharest 2025

Upcoming

Copa Latinoamericana 4
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
K-Championship
SEL Season 2 Championship
Esports World Cup 2025
HSC XXVII
Championship of Russia 2025
Murky Cup #2
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.