Search found 27 matches

by flashkot
Wed Aug 08, 2012 1:29 pm
Forum: Libraries and Tools
Topic: Playing Video. mjpeg decoder in pure lua. With audio!
Replies: 23
Views: 18431

Re: Playing Video. mjpeg decoder in pure lua. With audio!

Okay, i wash my hands. I get all fun from this idea. Maybe I come back to it someday. So now it's your turn - do what you want, but do not forget to share your beautiful results :) With good fine-tuning this method can allow you to have a nice cutscene in your game, played at full 25fps with resolut...
by flashkot
Wed Aug 08, 2012 5:40 am
Forum: Libraries and Tools
Topic: Playing Video. mjpeg decoder in pure lua. With audio!
Replies: 23
Views: 18431

Re: Playing Video. mjpeg decoder in pure lua. With audio!

Code is very ugly.

I just made some tests with different jpeg images. Looks like it is faster to load many small images than loading one big. 320x200 image loads 10 times faster than 640x400. I think image size has some limit after which it slows down a lot.
by flashkot
Wed Aug 08, 2012 4:47 am
Forum: Libraries and Tools
Topic: Playing Video. mjpeg decoder in pure lua. With audio!
Replies: 23
Views: 18431

Re: Playing Video. mjpeg decoder in pure lua. With audio!

I get source video from Wikipedia . Then converted it to image sequence (and also scaled to needed width*height) with ffmpeg. Then images was sticked with montage . I will post my scripts from home. You should wait something about 12 hours. :) I do not know about any performance boost with 16 frames...
by flashkot
Tue Aug 07, 2012 11:41 pm
Forum: Libraries and Tools
Topic: Playing Video. mjpeg decoder in pure lua. With audio!
Replies: 23
Views: 18431

Playing Video. mjpeg decoder in pure lua. With audio!

Ok, ok. The subject is a joke. A little bit. ;) But, anyway, this can be considered as mjpeg decoder. We decode jpeg's? Yes. We get motion? Yes! Is it pure Lua code? No. But only thing it needs - our lovely framework. When I was hit by this idea, i didn't know what something similar was already done...
by flashkot
Tue Aug 07, 2012 4:04 pm
Forum: Support and Development
Topic: UDP Networking Question
Replies: 8
Views: 3144

Re: UDP Networking Question

I think his idea was to just use words to distinguish one data type from another. In Lua socket you are sending and receiving strings. So, you should send your data like this: udp = socket.udp() udp:send("Name:KrimsonKing") udp:send("Position:37,16") On server side, you receive a...
by flashkot
Tue Aug 07, 2012 2:25 pm
Forum: Support and Development
Topic: UDP Networking Question
Replies: 8
Views: 3144

Re: UDP Networking Question

When you receive packet, you also get originating ip and port. You can create table players and add each sender to it using ip as a key. Then just check if record exists in table. For storing data in packet: check out my post https://love2d.org/forums/viewtopic.php?f=5&t=10363 may be it will be ...
by flashkot
Sun Aug 05, 2012 6:40 pm
Forum: Libraries and Tools
Topic: Packing data for UDP (and some questions)
Replies: 0
Views: 2383

Packing data for UDP (and some questions)

Today I was thinking about optimal data representation in UDP packets. I know what it is not a good idea to make UDP packet bigger than 512 bytes or so. In UDP tutorial from Wiki UDP packets are just human readable strings. What a waste of space, isn't it? ;) So, i decided to make C-like structs for...
by flashkot
Sun Aug 05, 2012 10:00 am
Forum: Support and Development
Topic: Player-enemy collision (I'm seriously stumped! : update)
Replies: 11
Views: 4263

Re: Player-enemy collision (I'm seriously stumped! : update)

One more trick i like: put comment on end for very big blocks. It helps to track where this end belongs to function player.update(dt) -- ... many many pages of very complex code... end -- function player.update or for i,v in ipairs(player.shots) do -- ... many many pages of very complex code... end ...
by flashkot
Sun Aug 05, 2012 9:49 am
Forum: Support and Development
Topic: Player-enemy collision (I'm seriously stumped! : update)
Replies: 11
Views: 4263

Re: Player-enemy collision (I'm seriously stumped! : update)

Again - watch your code indentation! :) I love Python for its strict indentation, very nice option for programming language you learn first. So, take a look at your ship.lua file. You placed collision detection in lines 72-74. Very likely that your problem is what you think, what this is the end of ...
by flashkot
Sat Aug 04, 2012 4:32 pm
Forum: Support and Development
Topic: Player-enemy collision (I'm seriously stumped! : update)
Replies: 11
Views: 4263

Re: Player-enemy collision (I'm seriously stumped!)

why you declare CheckCollision() function within love.update() ? Move its declaration somether outside love.update() . Better place it before all require comands in main.lua and watch your code identation! Some times it is hard to tell where your functions ends and where starts next function. And ch...