[Mod] Simple Mobs [mobs]

Locked
User avatar
Excalibur Zero
Member
Posts: 142
Joined: Tue Apr 02, 2013 19:45
GitHub: ExcaliburZero
Location: United States
Contact:

by Excalibur Zero » Post

Pavel_S wrote:
Excalibur Zero wrote:
Excalibur Zero wrote: I tried applying some of the rotations and scales and it is working correctly in Blender, however there is a problem with one of the wings in Minetest.

I put it together into a new mod (with the .blend file), which I put on GitHub here: https://github.com/rocketslime11/mobpack
Could someone take a look at the .blend and help me figure out why it isn't working properly? I'd like to see if it can be fixed to work in Minetest without having to redo all the animations.
I fixed all animations and model. But I think, you will slow down animation.
Download
New animation range.

Code: Select all

animation = {
        stand_start = 0,
        stand_end = 40,
        walk_start = 41,
        walk_end = 81,
        run_start = 83,
        run_end = 103,
        punch_start = 104,
        punch_end = 124,
        speed_normal = 62,
        speed_run = 103,
    },
About Modelling in Blender and exporting to Minetest!
At least you need to follow this:
Using Blender on Minetest wiki
Better explanation
If you do not export materials with .x, you need use as many textures as count of meshes in model;
There must be only one Armature;
Apply all transforms for your rest position.
Thanks a lot for the help!

I'll be sure to read those before I start animating the model next time.

----

I tried exporting it and it's working fine except the head isn't being textured for some reason.

Screenshot: http://i.imgur.com/j6XqUwc.png

I am using these export settings: Export Meshes, Export Normal, Export UV Coordinates,Export Material, Export Skin Weights, Export Armature Bones, Export Animations.

Are there any things that I am forgetting to export?
Last edited by Excalibur Zero on Thu Mar 06, 2014 23:05, edited 1 time in total.

User avatar
Pavel_S
Member
Posts: 131
Joined: Sat Apr 06, 2013 11:43

by Pavel_S » Post

You just need to stay one material, or uncheck "Export materials"

User avatar
Excalibur Zero
Member
Posts: 142
Joined: Tue Apr 02, 2013 19:45
GitHub: ExcaliburZero
Location: United States
Contact:

by Excalibur Zero » Post

Pavel_S wrote:You just need to stay one material, or uncheck "Export materials"
Thanks! That worked.

gsmanners
Member
Posts: 159
Joined: Fri Jan 10, 2014 21:37

by gsmanners » Post

I've recently discovered that removing this mod also reduces formspec lag by at least 50%. I can't overlook that, but I really hate to have to disable it, as well.

Formspec lag, for those who haven't noticed it, is that delay you sometimes get when using chests, furnaces, signs or anything that uses formspec (other than the player inventory).

I wonder if there's a solution that doesn't involve disabling this mod.

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

Maybe mobs idling could be set to not move at all (only move when chasing something), to save a lot of CPU. Also, make less mobs spawn, but more powerful ones.

gsmanners
Member
Posts: 159
Joined: Fri Jan 10, 2014 21:37

by gsmanners » Post

Reducing the step rate would definitely be a big plus for really low-end machines, but I don't think that's the issue I'm seeing. I think something in mobs is tying up the engine's formspec update mechanisms, and it maybe has more to do with how Irrlicht works than Minetest per se. I just wish I had some solid clues, but CPU and GPU is definitely not getting bottlenecked here. (I may be on a low-end machine, but it ain't that bad.)

gsmanners
Member
Posts: 159
Joined: Fri Jan 10, 2014 21:37

by gsmanners » Post

Followup: I did a little tweaking and I think on_step might be what's causing my lag. I did a little of this:

Code: Select all

        on_step = function(self, dtime)
            if self.stimer < 0.5 then        -- step timer
                self.stimer = self.stimer + dtime
                return
            else
                dtime = dtime + self.stimer
                self.stimer = 0
            end

            if self.type == "monster" and minetest.setting_getbool("only_peaceful_mobs") then
etc.

And bam, the formspec lag seemed much less. I might be onto something. I'll keep testing this, though.

EDIT: Never mind. Scratch that. Something is still screwy, no matter the step time.
Last edited by gsmanners on Wed Apr 16, 2014 22:16, edited 1 time in total.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

by 4aiman » Post

Hmm... 1/2 sec per mob's state update should be "ok" for any net play. Thanks, gsmanners!
This also decreased overall load and now I have 25-30 fps on my Aspire one! :)

User avatar
TenPlus1
Member
Posts: 3724
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

by TenPlus1 » Post

Does indeed lower lag and increaase fps on my system although it may just be me, but all monsters want to attack now instead of walking around...

gsmanners
Member
Posts: 159
Joined: Fri Jan 10, 2014 21:37

by gsmanners » Post

Monsters should want to attack, right? They are monsters, after all.

Okay, here's the thing:

If I put my game in survival mode, I get lag. No exceptions. If I put my game in creative mode, then I see the difference. That was the important thing I was missing. This mod + creative equals lag bomb in my formspecs (outside the player inventory, of course).

It's enough to make your head spin. Something going on in survival mode, only though. I'm going to narrow it down to the source, eventually.

Sokomine
Member
Posts: 4290
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

gsmanners wrote: Monsters should want to attack, right? They are monsters, after all.
Pretty stupid of them. They all eventually get killed by the players. They ought to run away as fast as they can whenever someone with a sword approaches! And then they ought to start buying in our shops :)
A list of my mods can be found here.

User avatar
Krock
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

Sokomine wrote:
gsmanners wrote: Monsters should want to attack, right? They are monsters, after all.
Pretty stupid of them. They all eventually get killed by the players. They ought to run away as fast as they can whenever someone with a sword approaches! And then they ought to start buying in our shops :)
Exactly. Monsters must learn out of that they did.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
AMMOnym
Member
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym
Location: Slovakia

Re: [Mod] Simple Mobs [mobs]

by AMMOnym » Post

Hi, can i know how to use 2d version ?

User avatar
MirceaKitsune
Member
Posts: 939
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Simple Mobs [mobs]

by MirceaKitsune » Post

I'm planning to make a game of my own soon, which will be heavily dependent on mobs. I took a look at this mod again, checking how it works as well as the script. Once again, I love how much was achieved with such simple and little code, and the mod supports most features and mob behaviors one would typically use.

But there are a few basic things missing, which I'd plan on using in my game at least. If it doesn't make the mod too complex for what's intended, I'd really appreciate it if you could add them as well. If not then perhaps someone else can make a fork, who can maintain it so everyone benefits from new features. If someone's willing to include them, I can try coding the changes myself. Anyway, here is my list:
  • You can specify an idle sound and an attack sound for each mob. Please also add a damage sound (played when the mob is hit) and a death sound. Also, I suggest allowing a list rather than just a string... so multiple sounds can be specified per event and a random one is triggered. This shouldn't be costly... just do something like minetest.sound_play(self.sounds.attack[math.random(1, #self.sounds.attack)]).
  • Please add a simple system for attack groups, so monsters can only attack specific players or other mobs. Any player and mob can have a list of the form self.team = {"team1", "team2"}. If a mob comes across a player or mob to which they don't have a common elements in this list, it will attack them, otherwise it will be peaceful toward them. Player names could be used directly to allow befriending individual mobs.
  • There's a flag for taming mobs, as well as mobs following players as they wield a specific item... but no way to make a mob permanently stick with a player (pets or recruiting). I'd appreciate it if mobs could be indicated a player which they will always follow (while not attacking someone else). My suggestion is simply a value which contains a player name or entity number, and activates the same code sheep currently use to follow players holding wheat.
  • Although I consider this less important, I suggest a list of nodes that mobs will mine / consume at a given frequency. For example, {"default:grass", 0.01} could be added to sheep to make them eat grass at a probability of 1 / 100 per tick. Whenever the probability succeeds in the step function, the mob scans for the nearest node of this type, and if there is one it will walk towards it... making the node disappear once it touches it.

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

Re: [Mod] Simple Mobs [mobs]

by BrandonReese » Post

I put my fork on github it has some of the things you want done, and I plan on doing the things you listed except for the taming. Someone might use it or just copy some of my changes to their fork.

https://github.com/Bremaweb/mobs/

Changes:
Fixed Mobs not jumping when chasing player
NPCs are peaceful until you attack them, and they will recruit nearby NPCs to come to their defense
Male NPCs attack monsters
NPCs and Barbarians use the 3D Armor Model
Added mob attack sounds (called war_cry when they initially attack)
Mob death sounds
Weapon sounds when attacking a mob (you define the sound where you define your tools). Weapon sounds are a table added to the tool def

Code: Select all

sounds = {[0]="default_sword_wood",[1]="default_sword_wood2"},
NPCs and Barbarians don't spawn automatically, they spawn when villages are spawned in my game.
Mobs/NPCs turn to look at you when you are nearby instead of just randomly turning, they will randomly turn when players aren't nearby

Edit:
Actually you probably won't be able to use my fork because of changes I made to default and this uses my skills and experience mods also, but maybe it will still help someone.

User avatar
MirceaKitsune
Member
Posts: 939
Joined: Sat May 21, 2011 22:31
GitHub: MirceaKitsune
IRC: Taoki
In-game: MirceaKitsune
Location: Romania, Bucharest

Re: [Mod] Simple Mobs [mobs]

by MirceaKitsune » Post

Good to know. Doesn't sound like I can use your fork directly though... if anything I'll make my own fork and add those changes. But I'd rather PilzAdam did them in the original mod or someone does a more popular fork so everyone can benefit, since the features I suggested are quite basic and shouldn't be a problem.

User avatar
Achilles
Member
Posts: 247
Joined: Sun Dec 15, 2013 11:55
In-game: Achilles
Location: Excuse Me???? -_-

Re: [Mod] Simple Mobs [mobs]

by Achilles » Post

NPC's?

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

Re: [Mod] Simple Mobs [mobs]

by BrandonReese » Post

Achilles wrote:NPC's?
Non Player Characters. They use the player model and skins, but they don't act much different than the mobs (other than they don't try to kill you) so calling them NPCs may be a little misleading.

Nathan
Member
Posts: 26
Joined: Thu Jun 12, 2014 23:00

Re: [Mod] Simple Mobs [mobs]

by Nathan » Post

This depends on "Default" and "Fire." Where do I get this "Fire" mod?

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

Re: [Mod] Simple Mobs [mobs]

by kaeza » Post

Nathan wrote:This depends on "Default" and "Fire." Where do I get this "Fire" mod?
It should be part of the default game.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

Nathan
Member
Posts: 26
Joined: Thu Jun 12, 2014 23:00

Re: [Mod] Simple Mobs [mobs]

by Nathan » Post

I have gotten the following error:

Code: Select all

Irrlicht log: Could not open file of texture: UV_rat.png
17:34:44: ERROR[ServerThread]: LuaEntity name "creatures:sheep" not defined
This error repeatedly shows up, and no sheep or rats will spawn.

User avatar
Inocudom
Member
Posts: 3121
Joined: Sat Sep 29, 2012 01:14
IRC: Inocudom
In-game: Inocudom

Re: [Mod] Simple Mobs [mobs]

by Inocudom » Post

Nathan wrote:I have gotten the following error:

Code: Select all

Irrlicht log: Could not open file of texture: UV_rat.png
17:34:44: ERROR[ServerThread]: LuaEntity name "creatures:sheep" not defined
This error repeatedly shows up, and no sheep or rats will spawn.
Nathan, your fist step is to get the latest development version of Minetest. If you have Windows, you can get a build of it from sfan5, BlockMen, or Fess.

User avatar
Casimir
Member
Posts: 1207
Joined: Fri Aug 03, 2012 16:59
GitHub: CasimirKaPazi

Re: [Mod] Simple Mobs [mobs]

by Casimir » Post

You can ignore the message about the sheep. It seems you had the creatures mod enabled and now disabled. The only thing that might happen is that you will find an "unknown entity" (formally known as sheep).

User avatar
lag01
Member
Posts: 321
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag
Contact:

Re: [Mod] Simple Mobs [mobs]

by lag01 » Post

Stupid me, i downloaded code from main branch on github from the link, rewrote almost half of it to make it work acceptable. and only now i looked at github and saw, that it has bunch of more recent forks :D
At least i had some practice at coding in LUA :)

User avatar
PilzAdam
Member
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam
Location: Germany

Re: [Mod] Simple Mobs [mobs]

by PilzAdam » Post

Nathan wrote:I have gotten the following error:

Code: Select all

Irrlicht log: Could not open file of texture: UV_rat.png
17:34:44: ERROR[ServerThread]: LuaEntity name "creatures:sheep" not defined
This error repeatedly shows up, and no sheep or rats will spawn.
This is not caused by this mod.
Inocudom wrote:
Nathan wrote:I have gotten the following error:

Code: Select all

Irrlicht log: Could not open file of texture: UV_rat.png
17:34:44: ERROR[ServerThread]: LuaEntity name "creatures:sheep" not defined
This error repeatedly shows up, and no sheep or rats will spawn.
Nathan, your fist step is to get the latest development version of Minetest. If you have Windows, you can get a build of it from sfan5, BlockMen, or Fess.
Telling people to use the latest dev version without knowing that it fixes the problem is bad. The latest dev version is unstable and might harm the system it runs on.

Locked

Who is online

Users browsing this forum: No registered users and 3 guests