Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   OMG, AI is so easy (https://postpacific.loc-online.com/showthread.php?t=3707)

Firedaemon 19.03.2006 08:11

OMG, AI is so easy
 
Seriously, I have found AI to be so incredibly easy. I dont know why I didnt dive right into it in the begining. I am a programmer so thats why it is easy, but I had no idea how easy it could be with NASC. I was really avoiding dealing with it for the longest time.

Today, I just removed about 30 mob classes from ai.obj and replced it with a single class. The class is seriously dope and handles everything including up to 6 attack spells, healing, buffing, raid boss & minions, soul crystal leveling, waypoints and even toggling of parameters like aggressivness, fleeing and alot more.

Previously ai.obj had classes for just about every senerio. NO MORE!

I may share the compiled ai code to everyone cause this ai code rocks so much. You can use one single class for all mobs including raid bosses and fighters. All parameters can be set straight from npcdata and npcpos for each mob.

Im excited if you cant tell. Share probably coming within days :)

Shawnmb 19.03.2006 09:02

Thanks for...filling us in >.>

knife_sj 19.03.2006 10:15

well, i cant learn ai cause nasc crashs on my pc ¬¬ dunno why
just c:\nasc.exe sample.ai and Chunk delphi debugger ¬¬

anyway gratz

Firedaemon 19.03.2006 10:34

Quote:

Originally Posted by knife_sj
well, i cant learn ai cause nasc crashs on my pc ¬¬ dunno why
just c:\nasc.exe sample.ai and Chunk delphi debugger ¬¬

anyway gratz

put nasc.exe in your scripts folder. Make sure you rename your ai.obj to something else though cause nasc will write over ai.obj

If the files it needs are not found then it will crash. Also, if you do not use it properly from the command line it will crash as well.

chdir to the directory it is in and then "nasc script.txt"

archy 19.03.2006 15:32

Seems like an extremely bad idea, as Raid bosses are ten times more complex than normal mobs - so all you do is slowing down the system.

But thats just what I think.

Shawnmb 19.03.2006 16:12

Quote:

Originally Posted by archy
Seems like an extremely bad idea, as Raid bosses are ten times more complex than normal mobs - so all you do is slowing down the system.

But thats just what I think.

Slow down the system? The whole point of the NPC server application is to run these scripts, let alone that if you check your TimeAnalasis while your server is running at full capacity, you'll notice that the NPC server still has plenty of room to work with.

archy 19.03.2006 16:17

Quote:

Originally Posted by Shawnmb
Slow down the system? The whole point of the NPC server application is to run these scripts

Actually, the point of NPC server is to use inheriting classes, not to run everything through one common class - that in runtime checks what its suppose to do.

Sauron 19.03.2006 17:52

cool man, i'm gonna merge elpy's ai with antaras's ai or even better the new 3er class change with a keltier.

c'on :roll:

Shawnmb 19.03.2006 17:55

<elpy runs into town, aggro, fossilizes everyone>

Metalmurphy 19.03.2006 20:38

Thats a very bad idea oO. Why are you going to overload a class with stuff they might not need? Also do those classes do MP checks? re use time checks? Smart ai instead of rand % to use skills? etc...

Aikeleer 19.03.2006 22:23

NASC is kinda so-so anyways, just learn writing the compiled code. :P

Firedaemon 19.03.2006 22:49

I am using the class strictly for warriors. Anything that fights using skills basically, which includes most mobs.

Yes it checks for MP consumption as well as checks for health before applying heals and buffs. It can also cast a certain spell on seeing an enemy as well. The onyl thing I have not built into it is the reuse delay calculation, but I will be adding that shortly. Also, I have it setup so that way it uses its skills in stages much like Antaras does with its skills.

If I have a mob with up to 4 attack spells, I divide the maximum health of the mob by the amount of attack spells (which is figures out all on its own) and then the mob uses each different spell as the mob gets lower in health. The thoery is, the more devastating the spell, the lower the mobs HP will be before it starts casting it. Progressive spell casting I think makes it more challenging to the player and allows them to deal with the mobs in stages.

Also dunno how you can say NASC is kinda so-so... its very powerful and my only guess is that you dont know how to program with it if you are under that impression. I actually do know how to write and deal with the compiled stack in ai.obj cause thats how I started with it. I didnt even bother with NASC until I had already written my own raid boss and raid fighter classes as well as a couple of quests from scratch.

I am all about building reusable code and I always build things that are optimized. I really do think this class is the bomb and when I share it with you guys I believe you will also be under the same impression; especially when you see it in action.

Hopefully I can have it shared within the next week with decent documentation. I also just implimented a timed auto-looter for unclaimed drops... in testing now.

FidoW 19.03.2006 23:00

Re: OMG, AI is so easy
 
Quote:

Originally Posted by Firedaemon
All parameters can be set straight from npcdata and npcpos for each mob.

i see a problem... with this kind of AI ... if I use //summon command npc don't work... can parse parameteres with summon command... or not ?

Firedaemon 19.03.2006 23:12

When you use //summon mob_name

It will automatically use the AI class and parameters set in npcdata

FidoW 19.03.2006 23:28

ouch, its true... im tired... i go to sleep a little... xD

Aikeleer 19.03.2006 23:45

Quote:

Also dunno how you can say NASC is kinda so-so... its very powerful and my only guess is that you dont know how to program with it if you are under that impression. I actually do know how to write and deal with the compiled stack in ai.obj cause thats how I started with it. I didnt even bother with NASC until I had already written my own raid boss and raid fighter classes as well as a couple of quests from scratch.
no use bragging about that, nothing special. Coding in the original stack stuff gives you way more control over your code imo, doing it exactly the way you want it and often in way less lines. I also worked with nasc a lot, I know how it works and I also made some stuff in it, but still I don't like it. :)

Sauron 20.03.2006 01:16

Quote:

Originally Posted by Aikeleer
Quote:

Also dunno how you can say NASC is kinda so-so... its very powerful and my only guess is that you dont know how to program with it if you are under that impression. I actually do know how to write and deal with the compiled stack in ai.obj cause thats how I started with it. I didnt even bother with NASC until I had already written my own raid boss and raid fighter classes as well as a couple of quests from scratch.
no use bragging about that, nothing special. Coding in the original stack stuff gives you way more control over your code imo, doing it exactly the way you want it and often in way less lines. I also worked with nasc a lot, I know how it works and I also made some stuff in it, but still I don't like it. :)

"original stack stuff " sucks, have you seen antaras ai?? It's hard to understand the 2100 lines it has decompiled i can't imagine reading it directly from ai.obj.

if the only thing you wanna do is adding the open/close door of a clan hall, ok that is a bit different because it takes 15min. however there are some other stuff that can not be done, well if ur patient you can do it in 3 years.
for example all the tattoo ai... my beta version (nasc) took me 5k lines, once compiled it is arround 85k lines, i actually coded in c++ to take the data from l2j and generate the nasc version and you are saying you prefer doing it directly in ai.obj...what can i say? o_O

SoaPy 20.03.2006 01:34

i coded a beta version of tatoo system directly in AI and has around 4k lines and isnt complete yet :P

Sauron 20.03.2006 01:45

well i know there are several ways of doing it, i did something similar of torune's share, anyway it's frozen i never tested it.

this is 1/3 of the script, it doesnt let me post it -.-

http://pastebin.com/611688

SoaPy 20.03.2006 01:51

that 300000 of adena is retail cost? because i dont know the real amount of it in retail :P

Sauron 20.03.2006 01:56

hehe i really don't know, i took the infro from a datapack.

i used this info (see below)

SoaPy 20.03.2006 02:00

ohhh i see ^^, tnx

Firedaemon 20.03.2006 02:01

Quote:

Originally Posted by Sauron
Quote:

Originally Posted by Aikeleer
Quote:

Also dunno how you can say NASC is kinda so-so... its very powerful and my only guess is that you dont know how to program with it if you are under that impression. I actually do know how to write and deal with the compiled stack in ai.obj cause thats how I started with it. I didnt even bother with NASC until I had already written my own raid boss and raid fighter classes as well as a couple of quests from scratch.
no use bragging about that, nothing special. Coding in the original stack stuff gives you way more control over your code imo, doing it exactly the way you want it and often in way less lines. I also worked with nasc a lot, I know how it works and I also made some stuff in it, but still I don't like it. :)

"original stack stuff " sucks, have you seen antaras ai?? It's hard to understand the 2100 lines it has decompiled i can't imagine reading it directly from ai.obj.

if the only thing you wanna do is adding the open/close door of a clan hall, ok that is a bit different because it takes 15min. however there are some other stuff that can not be done, well if ur patient you can do it in 3 years.
for example all the tattoo ai... my beta version (nasc) took me 5k lines, once compiled it is arround 85k lines, i actually coded in c++ to take the data from l2j and generate the nasc version and you are saying you prefer doing it directly in ai.obj...what can i say? o_O

Yeah the application logic layout of the original stack is just so combersome compared to writing nice clean and easily understandable code. Guess thats why we all have programming languages like C++ and Java because the entire world didnt want to program everything in ASM.

While you may prefer notepad to to write combersom line after line, with NASC you accomplish the same thing in probably 1/10th of the time.

Although I am prefering NASC rather than doing each line; I am not knocking it doing that way though. Every developer has their own way of doing things. I guess the real measure of success is the fruits of your labor and what and how mu9ch you achieve doing it your way.

SoaPy 20.03.2006 02:05

yes i know that some people can code in nasc in less time than me in the compiled AI but i dont understand the whole sintax of nasc because i dont know C++ ^^ or any of that languaje but i know the sintax of a primitive stack language :P

krapno 20.03.2006 02:14

interesting topic ... i am a NASC fan :D

archy 20.03.2006 05:48

Firedeamon,

Why do you think AI supports inheriting classes?

1. It removes the need to code a single class for each and every NPC - just because they are a little different from eachother

2. It removes the need to code a common AI class like you are doing.

Your idea is flawed, yes NASC/AI is powerfull, even more than you think it would seem.

Mark20 20.03.2006 08:35

I see a L2OFF server where NPCs send greetings like retail... and talk to player when is close, this is possible with AI ? anyone knows ?

I know talk is posible, but greetings ?

Firedaemon 20.03.2006 10:37

Quote:

Originally Posted by archy
Firedeamon,

Why do you think AI supports inheriting classes?

1. It removes the need to code a single class for each and every NPC - just because they are a little different from eachother

2. It removes the need to code a common AI class like you are doing.

Your idea is flawed, yes NASC/AI is powerfull, even more than you think it would seem.

Well I am not by any means using a single class for all the mobs. Only those which are spellers pretty much, including raid bosses and fighters. Im running it right now and its running great.

I do completley understand the whole inherited class thing and it is great. But having reusable code is also very valuable as well as way more flexible than 300 functions which all do the same thing anyway pretty much.

I am still taking advantage of the inherited classes and such... I just got rid of all the garbage and condensed it down to a streamline class. You can diss it all you want, but the functionality I have built into it gives way more power and flexibility to me as a developer in creating a streamlined AI that players can interact with.

Dunno how you can say its flawed... 600 concurrent players are interacting with hundreds of mobs using the class right now and there is no performance loss. In addition I have complete flexibility with the mobs now whereas previously I did not. Before I would have to copy and past the same crap over and over again in different places when the mobs could simply be utilizing the application logic L2NPC.exe was written for. When it comes to upgrading or scalability it will be far superior to having 50 different classes that do just about the same thing with only a slight difference here or there.

Metalmurphy 20.03.2006 20:09

Quote:

Originally Posted by Mark20
I see a L2OFF server where NPCs send greetings like retail... and talk to player when is close, this is possible with AI ? anyone knows ?

I know talk is posible, but greetings ?

Yes and it has been posted already, dont hijack this thread


All times are GMT. The time now is 16:23.