Good vs. Evil

  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
50 WASM needs to be written in Rust, C, or C++? I was unaware. As far as I knew, it was essentially another form of bytecode that would be natively ran by browsers, saving runtime compilation that happens with JS. In theory, shouldn't most languages be compilable into it?
51 in theory yes, however it has no garbage collection making it hard to port languages like java, C#, lua or python. That doesn't mean they can't be ported and in fact I know that C# and Lua are but they are ported by having their VM compiled to WASM rather than having your code compile to WASM.

Because of this I personally consider those languages out of scope for this exercise (as I feel I'm experimenting with those VM versions rather than with WASM)

Another reason that I didn't like to use those VM's is that except for the C# one there are no frameworks written yet that are meant to run in the browser and because they run in their own VM it is also harder to play with the communication between JS and WASM. On the other hand, I already knew of yew's existence.

Oh, and if you don't like Rust, C and/or C++. Fear not, garbage collection is something that is planned to get into WASM.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
54 so... I come a bit closer every day to what I want to make.
I currently have a component that has an internal counter and renders said count together with a button to increase this. When you press this button it also fires of an event together with the current count.
This will eventually become the component that the user uses to "buy" new characters.

I also have a really, really basic component that I can use to render characters. Currently it just gets their type as input and displays the type name. However, this will change later on so it gets a character object instead.

Also, components really NEED a change function. Otherwise, it will crash the moment their props change. Sadly enough, missing this doesn't lead to a compile time error. :(

Lastly, the message system is pretty much as powerful as normal functions. My fear originally was that I had to wrap a message into a function whenever I would have the need to actually make use of the data from an event but as it turns out, messages can carry data as well.

Oh, and I also figured out how to make a custom index.html and where I would need to place my assets. That.... is always a good thing.

So... now time to turn this simple number into an array/list/whatever and after that its time to flesh out my characterDisplay component.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
56 I can't complain.
I'm currently at the point where characters are stored in a LinkedList as my options where rather limited and this was the only one I both felt comfortable with AND that performs well when inserting at the front of it. Granted, I could've chosen to loop over the list in reverse order and place new items at the end but..... that takes more research time and I probably won't share the list with other components, making it easy to switch it out later :)

I also made it so my test data are now very basic character objects. However, I'm planning to change that object quite a bit and I'm probably going to end up removing its "constructor" as its not really needed.

My plan for the next two days is to start documenting the things I did and maybe put it on github. As I probably don't feel like working on it when I come back from programming a whole day at work.

Anyway, next up on the to do list: make characters in the list nicely render. This means that I need to gather images of fantasy creatures and make names for them. So.... feel free list names of both specific creatures and list species. Note that species don't have to be humanoid, just capable of fighting in some way, shape or form.

For species I plan to show:
  • A short description
  • A name
  • A free to use image
For now I don't plan on giving them any special stats, but who knows how far I end up going with it as I actually really enjoy learning rust right now. This also means that I don't have any plans for special creatures but at the same time I really wouldn't mind it if I end up at that point....
 

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
56. I hadn't looked into Baba Yaga, but I should. I could probably do to build up some coven stuff, get myself a familiar, all that jazz.
 

lenscas

Over-Achiever
Jul 31, 2013
2,015
1,801
248
58 so... work was going slow meaning that I actually felt like working on the project after I was done. I focused on making the only components I had look a bit nicer, and... I think its starts to look like something now.
upload_2018-12-17_22-4-0.png


The 0 is just a placeholder and will eventually show the amount of money you have. (which will also be a bit more clear)
The colors/values on the progress bars are calculated rather than hard coded (though, their health is).
Everything above 50% = green
Above 20% = yellow
Everything else = Red

I also cleaned my Character object up a bit. The constructor is now part of the Struct and it has a method called get_image which simply returns the correct path decided by the character type of a character.
 

duckfan77

Popular Member
Mar 18, 2013
80
683
118
57 Well, I was almost late to my final... I need to read my emails more often. Think it went well though.
 

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
60. I assumed he meant "they" as in the finals as well :) I'm glad you weren't late - fingers crossed it all went well!
 

duckfan77

Popular Member
Mar 18, 2013
80
683
118
61 Better than when your functions do completely different things than what they're called or the documentation says they do, which is the current state of one of my projects...
 

duckfan77

Popular Member
Mar 18, 2013
80
683
118
61 That final was horrible. I'd be surprised if 5 out of the 120+ people in the class finished it... At least I'm done and home.