Categories: DiscussionValheim

I want to program a simple valheim NPC client (a bot)

Hi, I've been playing a lot of valheim lately. And what I've been doing is go to a virgin Island and build houses, roads, ports, store houses, cultivation etc.. basically I'm making whole villages.

But my villages are empty !

So here is my proposal.

I'm an ok VB.net programmer (please don't throw eggs yet) and I want to build a npc from scratch.

First version would be like this, using wireshark, sniff client-server valheim network traffic. Figure out the initial handshake and the downloading of the map.

The NPC logic would be as follows.

Teleport to preset coordinates in in file.

Find nearest unclaimed bed and claim it.

Check time of day

If before sleep time, walk to preset coordinates (preconfigured "geofenced" work area).

When inside the zone. Search map for nearest tree in the zone (this is a lumberjack bot for now)

Hit tree with axe until server says tree is broken.

Walk to pickup able object inside work zone.

If inventory full, search work zone for non full chest. Dump wood in chest.

If axe breaks, search map for nearest workbench and repair.

If enemy nearby, run away in any non water direction.

In case of any error, go to bed(teleport if necessary) and try to sleep every 60 seconds.

When time of day greater than sleep time, go to bed and sleep.


If I can get that far, I can make NPCs that can do anything, including harvesting simple quest giving and enemy NPCs.

Has anyone tried this before is there any documentation of the network protocol this game uses ? Thanks !

Gamer

Recent Posts

Ledx have been so hard for me this wipe

Not being able to craft them sucks. Especially when everyone I talk to about it…

1 year ago

My interesting and unfortunate Gwent life

First I'd like to say I absolutely love this game it's quality. Basically I first…

1 year ago

Teacher Tuesday 12/Dec/2023 – ask your questions here!

Welcome to Teacher Tuesday, a thread where anyone can ask any type of question without…

1 year ago

This games balance is confusing

I’m kind of new/returning to gwent I played beta and obviously it’s a lot lot…

1 year ago

Summary of 10 Days of Draws from Chaffee’s Bundles

Level 1 Bag (Free with Atmosphere Level 2) 6 small consumable (First Aid, Repair, Fire…

1 year ago

Why is my crew at 135%?

Here's my crew - T34-85M - for the life of me I cant figure out…

1 year ago