cloudmracek / bandwidthps1game Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
Hola,
I saw your video, super cool btw. And I can't let pass this loooong line:
SquareRoot0(abs((pos.vx - enemies[j].pos.vx) * (pos.vx - enemies[j].pos.vx)) + abs((pos.vz - enemies[j].pos.vz) * (pos.vz - enemies[j].pos.vz)));
I don't know which compiler is used for compile to PSX, because depending on the compiler the stdlib implementation could change in sort kind. Also I dunno what the heck is SquareRoot0 (I sneaked in the SDK source code, but is fully assembly and exceed my knowledge), if you know and you want to explain me, would be really great!.
So...
pos.vx - enemies[j].pos.vx
and pos.vz - enemies[j].pos.vz
-> can pass this to a variable for computes once.
You're requiring for the Absolute Value, as you already know the abs value is just the positive value of any Real Number, so you can use a Macro Function -> #define ABS(N) (N < 0 ? -N : N)
. With this you avoid passing as argument and call to a function. Also, I think the implementation of abs
function does the same thing (because is pure math logic description).
Referencing to the previous point, you already getting the abs value when you do the multiplication. That's because of the two factors will have the same sing (- * - = +) and (+ * + = +). So, if I understood correct, you don't need to calculate the abs value. In case I understood wrong, just use the MACRO 🙂.
(Optional). If you are lazy as me, use a MACRO for Cuadrado (no idea how to say it in english) -> #define CRD(N) (N * N)
.
So the final image will be:
#define ABS(N) (N < 0 ? -N : N)
#define CRD(N) (N * N)
int vx = (pos.vx - enemies[j].pos.vx);
int vz = (pos.vz - enemies[j].pos.vz);
SquareRoot0((CRD(vx))+(CRD(vz)));
This is an executable example in C Playground
I hope it help for the improvement of performance, I'm not a C dev so I can't guarantee.
Greetings from Argentina!. Super good job with this and the video, you got a new sub!.
sorry but i dont see is or just dont know how to convert it into iso file i wanted to burn it into my cd but i dont see iso file i think i have to burn iso file i am not sure i just wanna play this game but i dont know where is the iso file does it work if i will just download it as zip and convert it into iso file. does it work like that? i just want to play that game
navíc jsem čech
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.