Search found 107 matches

by Przemator
Fri May 03, 2019 7:00 am
Forum: Libraries and Tools
Topic: Lua Vector
Replies: 11
Views: 2892

Re: Lua Vector

I should add, that I profiled my code for a simple racing game. First I used hump.vector After 10 seconds of profiling, there have been 50'000 calls to " isvector ", which occupies 0.5 sec of CPU time, compared to 2 sec of total time. So I decided to switch to hump.vector-light and I saved 25% of CP...
by Przemator
Thu May 02, 2019 7:15 pm
Forum: Libraries and Tools
Topic: Lua Vector
Replies: 11
Views: 2892

Re: Lua Vector

hump.vector also has dot product. it's done using the __mul operator (vector * vector). it's not only returning the x, y, it creates a new vector (or you can explicitly use methods, which modify the vector itself). There is no round, but there is normalized and trimmed. The way I see it, you've done...
by Przemator
Thu May 02, 2019 8:34 am
Forum: Libraries and Tools
Topic: Lua Vector
Replies: 11
Views: 2892

Re: Lua Vector

How is it better than hump.vector? or hump.vector-light?
by Przemator
Wed May 01, 2019 11:04 am
Forum: Libraries and Tools
Topic: "profile.lua" a tool for finding bottlenecks
Replies: 25
Views: 11727

Re: "profile.lua" a tool for finding bottlenecks

By the way, regarding the memory issue. The way it’s solved on the Oracle database I work with is following. First the profiling data is dumped into a file, which just keeps growing. It can easily get to 2 GB in just a few minutes. Then I supply this file into a report generator, which either create...
by Przemator
Wed May 01, 2019 7:57 am
Forum: General
Topic: Collision detection without physics?
Replies: 14
Views: 12587

Re: Collision detection without physics?

I implemented my collisions the following way: the collisions between cars are made using distance. I measure the distance between all cars then get the smallest distance that is below the threshold (say, 32 pixels). Then i "push" the cars away from each other. I repeat until all cars are at least 3...
by Przemator
Tue Apr 30, 2019 7:22 pm
Forum: Libraries and Tools
Topic: "profile.lua" a tool for finding bottlenecks
Replies: 25
Views: 11727

Re: "profile.lua" a tool for finding bottlenecks

I work with Oracle, and the software I use generates really cool clickable SVG flame graphs . http://www.brendangregg.com/FlameGraphs/cpu-linux-execs.svg You're right, that it's useful to know the total elapsed time for a function, but it also helps to know which functions have been calling it. Don'...
by Przemator
Tue Apr 30, 2019 4:51 pm
Forum: Libraries and Tools
Topic: "profile.lua" a tool for finding bottlenecks
Replies: 25
Views: 11727

Re: "profile.lua" a tool for finding bottlenecks

This profiling tool is fantastic. Thanks Ivan! Would it be technically possible to make the profiling hierarchical? That is, if a function bar is called inside a function foo, it would be displayed as: Function Calls Time /foo 1 5.0 /foo/bar 2 3.2 /foo/baz 1 1.5
by Przemator
Fri Apr 26, 2019 8:54 am
Forum: General
Topic: Collision detection without physics?
Replies: 14
Views: 12587

Re: Collision detection without physics?

Yes, I saw your code. It's a neat trick with the string. But I decided against it, since I would not like to use graphics functions for collision detections. Graphics functions can only run from the main thread, so this would be a limitation, should I choose to separate update from drawing. In the e...
by Przemator
Thu Apr 25, 2019 1:17 pm
Forum: General
Topic: Collision detection without physics?
Replies: 14
Views: 12587

Re: Collision detection without physics?

I've been considering this, but each track also has parameters: acceleration and turn rate per each update (e.g. move by 10 pixels and rotate by 4 degrees). It's just all not physics-based.
by Przemator
Thu Apr 25, 2019 9:53 am
Forum: General
Topic: Collision detection without physics?
Replies: 14
Views: 12587

Re: Collision detection without physics?

I'm trying to rewrite a 20yo racing game, which is using black&white mask PNGs for collisions. Black = Track, White = Wall. And the car is also White. I'm trying to figure out how to implement it with löve. How would I even detect a collision using images? And if there are many cars, should I check ...