Page 1 of 2

Release: Picture-in-Picture

Posted: 06 Nov 2010, 09:52
by Niobium
Download link can be found here: http://widgets.springrts.de/index.php#180

[Screenshot]

Description (from link):
Provides a picture-in-picture type window that shows a location on the map and the units at that location.

In addition it allows you to control the units within the window, so you could for example watch and manage your base while simultaneously watching and microing your frontline (the primary focus of the widget).

What it does:
- Draws units and features
- Allows selection of units within window
- Supports most commands (issued onto the window or units within)
- Draws command queues within window (with shift held)
- Many miscellaneous toggles on buttons; tracking units, switching current view with pip view, drawing only blobs (for far zoom or slow computers), and some other things.

What it doesn't do:
- Anything advanced, i.e. custom formations, projectiles, selection rectangles etc. The goal of the widget is not to perfectly replicate spring, just simple viewing and minor unit management like queuing within a base.

What this thread is for:
- Comments, bugs, ideas for improvement, etc.

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 10:07
by Niobium
One issue that I assume is really easy to solve is that I'm not able to remove the 'perspective' from :DrawScreen, in that translations in the z direction (in and out of the screen) cause the drawn unit to shift around in x/y depending on location of the window.

What I'm after is a top-down view everywhere (such that z translation does nothing), which would fix some of the minor oddities that exist atm.

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 10:17
by knorke
on enabling the widget spring hangs for 2 seconds then crashes:
http://pastebin.ca/1983496

/e
it also crashes when enabling the widget before a unit was spawned

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 10:36
by hoijui
translated knorkes stack-trace. was not able to attach to forum thread, cause it is evil HTML (renaming to .txt neither works):
http://pastebin.com/jwCE2MiJ

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 10:42
by Niobium

Code: Select all

for fDefID, fDef in pairs(FeatureDefs) do
    local fRad = fDef.radius
end
The above code alone causes spring to crash... (specifically the .radius line)

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 10:56
by Jazcash
Very good idea, when this works I'll try it out and hopefully use it in place of my minimap or something seeing as I pretty much never use the minimap anyway.

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 11:10
by Niobium
Updated widget to v1.1 with workaround for Spring crash in XTA.

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 11:35
by Beherith
This is absolutely fucking amazing!
Thank you very much for it.

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 13:42
by Chojin
Agreed! Very cool :)

There is some shifting of map & units at the moment. See this screenshot and compare the metal spot in the PIP to the real location on the main view: http://spring.develz.org/stuff/screensh ... _metal.png

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 14:43
by Niobium
Chojin wrote:Agreed! Very cool :)

There is some shifting of map & units at the moment. See this screenshot and compare the metal spot in the PIP to the real location on the main view: http://spring.develz.org/stuff/screensh ... _metal.png
What map is that? In my testing I haven't been able to get things out of alignment. In addition, the button textures aren't transparent..

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 16:40
by Chojin
Oh, right, not transparent - didn't see that yet. First I thought the rescaling of the screenshot messed it up, but here is a plain screenshot:
http://spring.develz.org/stuff/screensh ... etal_2.png

The map is called BarracudaBay and I tried with BA v7.19 and additionally have these slightly modified widgets running.

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 17:15
by very_bad_soldier
Really stunning Nio!

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 21:31
by TheEpicMang
I don't like it much, I find it kind of distracting

I'd like it if you could make a bind to toggle it on and off because I am usually not using it and I dont want it in the way but on some occasions like if im microing a peewee in enemy base and I dont want to sit there watching it take ages to kill a lab I could just turn it on and then go do something else while keeping an eye on my peewee, make sure it doesnt get attacked

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 22:09
by aegis
and it crashes sometimes... needs group selection inside for me instead of dragging (could use middle click instead)

awesome widget though, it's inspiring me to do something similar... using sockets (I'll post if I can get it done this weekend)

Code: Select all

[   8471] gl.BeginEnd: error(2) = [string "LuaUI\Widgets\gui_pip.lua"]:488: GetUnitPosition(): Bad unitID: %i
[   8471] false
[   8471] Error in DrawScreen(): [string "LuaUI\Widgets\gui_pip.lua"]:488: GetUnitPosition(): Bad unitID: %i
[   8471] Removed widget: Picture-in-Picture

Re: Release: Picture-in-Picture

Posted: 06 Nov 2010, 23:40
by very_bad_soldier
aegis wrote: awesome widget though, it's inspiring me to do something similar... using sockets (I'll post if I can get it done this weekend)
We have sockets now? How about that "minimap-on-second-monitor"-thingie?

Re: Release: Picture-in-Picture

Posted: 07 Nov 2010, 00:09
by aegis
I'm making a wrapper around lualobby for sockets.

Re: Release: Picture-in-Picture

Posted: 07 Nov 2010, 04:18
by Niobium
Version 1.2 released !
- Fixed widget crashing on drawing odd commands (the one mentioned by aegis)
- Added minimize button (Note: Minimizes away from screen center)
- Added simple colors button (Works just like minimap simplecolors)
- Added tooltips to all buttons explaining what they do
- Added default commands (move/guard/attack/reclaim)

Chojin wrote:The map is called BarracudaBay and I tried with BA v7.19 and additionally have these slightly modified widgets running.
The misalignment is due to the map, it provides it's own minimap texture (which is what this widget uses) where the metal doesn't match up with the ground texture, you can see this if you maximize your minimap.

As for the texture issue, I still have no idea. Do they become transparent if you disable all other widgets?

Re: Release: Picture-in-Picture

Posted: 07 Nov 2010, 16:01
by very_bad_soldier
Maybe auto-center on start position at game start?

Re: Release: Picture-in-Picture

Posted: 07 Nov 2010, 19:36
by KaiserJ
neat idea!

i can't help but think the ability to bind the PIP window to a unit (scout for instance) might be useful

Re: Release: Picture-in-Picture

Posted: 07 Nov 2010, 21:28
by aegis
KaiserJ wrote:i can't help but think the ability to bind the PIP window to a unit (scout for instance) might be useful
you can, one of the buttons starts tracking whichever unit is currently selected