Page 1 of 1

Why not use Rust for BT?

Posted: Sat Jun 10, 2023 6:25 am UTC
by SuperDupont

Why not use Rust language for BT (Behavior Tree)?

In Rust, an oriented objects (but not objects), we have:
- enum : https://doc.rust-lang.org/book/ch06-01- ... -enum.html
- controls flow : https://doc.rust-lang.org/book/ch03-05- ... -flow.html
- ...

I like how this language working, his compilator that is untolarable.

So, by adding Rust in Unvanquished we can make it more interesting and complex too.
And, needn't to code in C or C++.
And in fact, debuguing current BT language is a pain.

I know, it won't be easy to connect bots to another program.
If there is like an API or something like that, where data for each bot are exported, and command can be read too... will be good.
So, on some more powerfull server we can have more individual bots (and contributions).

Yes, it's a dream.


Re: Why not use Rust for BT?

Posted: Tue Jun 20, 2023 3:59 pm UTC
by SuperDupont

Sure, I agree.

I don't say Rust must be in the Unvanquished at the end.

If we can have API or sockets or... something that devs knows, where :
- The server can send datas for each bots (what the bot see, what he has), like we already have for clients
- Something to give orders, like we already have as a client.

May be we should start from a new client without graphical computing.
So, we can have several tools for BT... (of course =, will only have one BT).

In this way, each "clients bots" can run on other threads/cpu, without doing something complex.
Of course, each "clients bots" must be lunched by something, like the server.


Re: Why not use Rust for BT?

Posted: Tue Jun 20, 2023 4:37 pm UTC
by Ingar

Why not Cobol, Pascal, Java, Haskell, C#, Go, perl, ruby, python, visual basic?
Oh wait, no visual basic please.

But in all seriousness, because the people who wrote the thing wrote it in C/C++.


Re: Why not use Rust for BT?

Posted: Mon Jun 26, 2023 8:17 am UTC
by Gireen

Yes its possible to create third party programs to control bots.
In my case i did that with javascript and send commands to the server.
But this works only for high level control of bots, else you have to recreate and simulate more and more of the engines gamestate and rules.
And sooner or later you have recreated half the engine in another language. :grin: