New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add binoculars mod with binoculars item to allow zoom #1881

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
@paramat
Member

paramat commented Aug 30, 2017

Add binoculars mod with binoculars item to allow zoom

Uses the new player object property 'can zoom'.
In survival mode, use of zoom requires the binoculars item in
inventory.
Zoom is automatically allowed in creative mode and for players with
the 'creative' privilege.
The binoculars.update_player_property() function is global so can be
redefined by a mod for alternative behaviour.
/////////////////

screenshot_20171003_235801

Addresses #1788

"Crafting
binoculars:binoculars

default:obsidian_glass O
default:bronze_ingot B

O_O
BBB
O_O

Usage
In survival mode, use of zoom requires the binoculars item in your inventory.
It can take up to 5 seconds for adding to or removal from inventory to have an
effect, however to instantly allow the use of zoom 'use' (leftclick) the item.

Zoom is automatically allowed in creative mode and for any player with the
'creative' privilege.

The 'binoculars.update_player_property()' function is global so can be
redefined by a mod for alternative behaviour."

Behaviour is not ideal yet, but we intend to add inventory callbacks later so that adding and removal have instant effect, for now i have used a short update interval.

binoculars128

ka026-2

@TumeniNodes

This comment has been minimized.

Show comment
Hide comment
@TumeniNodes

TumeniNodes Aug 30, 2017

Contributor

I feel as though the telescope texture would look better with a brassy color. Just a personal opinion.
I like this entire idea though, nice.

Contributor

TumeniNodes commented Aug 30, 2017

I feel as though the telescope texture would look better with a brassy color. Just a personal opinion.
I like this entire idea though, nice.

@tenplus1

This comment has been minimized.

Show comment
Hide comment
@tenplus1

tenplus1 Aug 30, 2017

Contributor

+1 but change recipe to use bronze, giving the ingots a good use.

Contributor

tenplus1 commented Aug 30, 2017

+1 but change recipe to use bronze, giving the ingots a good use.

@DS-Minetest

This comment has been minimized.

Show comment
Hide comment
@DS-Minetest

DS-Minetest Aug 30, 2017

Contributor

It would be easy to keep the zoom priv.

Contributor

DS-Minetest commented Aug 30, 2017

It would be easy to keep the zoom priv.

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Aug 30, 2017

Member

Yes i'll use bronze, good idea, i used to have an antique gold coloured telescope.

Member

paramat commented Aug 30, 2017

Yes i'll use bronze, good idea, i used to have an antique gold coloured telescope.

@paramat paramat added the WIP label Aug 30, 2017

@rubenwardy

This comment has been minimized.

Show comment
Hide comment
@rubenwardy

rubenwardy Aug 30, 2017

Member

I'd prefer binoculars, as it's zoom. Telescope is usually for the heavens.
It would also be nice if it worked the same way as map did, ie: has to be in the inventory.
Edit: this is a PR, it already does work like that.

Member

rubenwardy commented Aug 30, 2017

I'd prefer binoculars, as it's zoom. Telescope is usually for the heavens.
It would also be nice if it worked the same way as map did, ie: has to be in the inventory.
Edit: this is a PR, it already does work like that.

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Aug 30, 2017

Member

Telescope is more period and genre-universal, binoculars are more modern.
This is meant to be a small telescope for landscape / sea use.
I would like to make zoom more powerful in settings, and also make it load more distant map (and remove the wieldhand), stuff for engine.

Member

paramat commented Aug 30, 2017

Telescope is more period and genre-universal, binoculars are more modern.
This is meant to be a small telescope for landscape / sea use.
I would like to make zoom more powerful in settings, and also make it load more distant map (and remove the wieldhand), stuff for engine.

@TumeniNodes

This comment has been minimized.

Show comment
Hide comment
@TumeniNodes

TumeniNodes Aug 30, 2017

Contributor

Well, binoculars have been around since approx. 1820's? I believe but, I like the use of a telescope more.

Contributor

TumeniNodes commented Aug 30, 2017

Well, binoculars have been around since approx. 1820's? I believe but, I like the use of a telescope more.

@Fixer-007

This comment has been minimized.

Show comment
Hide comment
@Fixer-007

Fixer-007 Aug 30, 2017

Contributor

Will it look like this?
flashpointresistance2014-02-1900-09-20-81

Contributor

Fixer-007 commented Aug 30, 2017

Will it look like this?
flashpointresistance2014-02-1900-09-20-81

@JurajVajda

This comment has been minimized.

Show comment
Hide comment
@JurajVajda

JurajVajda Aug 30, 2017

Isn't telescope used for looking at the stars/space/planets due to its higher magnification and bigger lense while binoculars have lover magnification therefore they are used for magnifying i.e. sport events, hunting, military targets?

JurajVajda commented Aug 30, 2017

Isn't telescope used for looking at the stars/space/planets due to its higher magnification and bigger lense while binoculars have lover magnification therefore they are used for magnifying i.e. sport events, hunting, military targets?

@Fixer-007

This comment has been minimized.

Show comment
Hide comment
@Fixer-007

Fixer-007 Aug 30, 2017

Contributor

Yes, good binoculars are awesome (trust me).

Contributor

Fixer-007 commented Aug 30, 2017

Yes, good binoculars are awesome (trust me).

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Aug 30, 2017

Member

Updated to bronze, engine PR merged, however ..

ka026-3

I didn't realise binoculars went so far back, these ones are Victorian and bronze, and look very 'steampunk' so yes i'll redo the texture to be these, and rename the mod.

Member

paramat commented Aug 30, 2017

Updated to bronze, engine PR merged, however ..

ka026-3

I didn't realise binoculars went so far back, these ones are Victorian and bronze, and look very 'steampunk' so yes i'll redo the texture to be these, and rename the mod.

@paramat paramat added the WIP label Aug 30, 2017

@rubenwardy

This comment has been minimized.

Show comment
Hide comment
@rubenwardy

rubenwardy Aug 30, 2017

Member

I suggest making a monocular(?) craft item (ie: one of the shafts) and then produce a binocular by combining too of them.

ie:

monocular:

# # #
|   |
# # # 

# - steel/bronze
| glass

--------------------------------------

binocular

shapeless,
BB

B=monocular

I'm not that fussed though

Member

rubenwardy commented Aug 30, 2017

I suggest making a monocular(?) craft item (ie: one of the shafts) and then produce a binocular by combining too of them.

ie:

monocular:

# # #
|   |
# # # 

# - steel/bronze
| glass

--------------------------------------

binocular

shapeless,
BB

B=monocular

I'm not that fussed though

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Aug 30, 2017

Member

Yes good idea.

Member

paramat commented Aug 30, 2017

Yes good idea.

@rubenwardy

This comment has been minimized.

Show comment
Hide comment
@rubenwardy

rubenwardy Aug 30, 2017

Member

Maybe Binocular Tube would be a better name

Member

rubenwardy commented Aug 30, 2017

Maybe Binocular Tube would be a better name

@jastevenson303

This comment has been minimized.

Show comment
Hide comment
@jastevenson303

jastevenson303 Aug 31, 2017

Contributor

I always called it a spyglass.

Contributor

jastevenson303 commented Aug 31, 2017

I always called it a spyglass.

@jastevenson303

This comment has been minimized.

Show comment
Hide comment
@jastevenson303

jastevenson303 Sep 19, 2017

Contributor

Does this need, uhh, testing or something? I might put start using it now because I'm getting anxious for this, and the map item. :) (I'll test.)

Edit: Nice! I like it. It wasn't immediately obvious to me, however, that its on_use function was to immediately enable zooming, as opposed to waiting the seven seconds.

How about a minetest.chat_send_player() or some such?

Contributor

jastevenson303 commented Sep 19, 2017

Does this need, uhh, testing or something? I might put start using it now because I'm getting anxious for this, and the map item. :) (I'll test.)

Edit: Nice! I like it. It wasn't immediately obvious to me, however, that its on_use function was to immediately enable zooming, as opposed to waiting the seven seconds.

How about a minetest.chat_send_player() or some such?

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Sep 19, 2017

Member

I'll be working on the bronze binocular texture soon, i'm still enthusiastic about this and will complete it soon.

Member

paramat commented Sep 19, 2017

I'll be working on the bronze binocular texture soon, i'm still enthusiastic about this and will complete it soon.

@C1ffisme

This comment has been minimized.

Show comment
Hide comment
@C1ffisme

C1ffisme Sep 19, 2017

I don't like the idea of a monocular tube. Unless you plan on using it in other recipes (like an astronomy telescope or a scope for a weapon) craftitems for the sake of crafting are bad. It just raises the obvious question: Why couldn't I just craft the goal item without making a transition item?

C1ffisme commented Sep 19, 2017

I don't like the idea of a monocular tube. Unless you plan on using it in other recipes (like an astronomy telescope or a scope for a weapon) craftitems for the sake of crafting are bad. It just raises the obvious question: Why couldn't I just craft the goal item without making a transition item?

@jastevenson303

This comment has been minimized.

Show comment
Hide comment
@jastevenson303

jastevenson303 Sep 20, 2017

Contributor

this is a base subgame with the purpose of expansion. your point is lawed cl1ffisme.

Contributor

jastevenson303 commented Sep 20, 2017

this is a base subgame with the purpose of expansion. your point is lawed cl1ffisme.

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Sep 20, 2017

Member

Why couldn't I just craft the goal item without making a transition item?

Because look at the crafting for a telescope, it is not possible to craft 2 telescope tubes side by side on a 3x3 grid, that's the only reason.

Member

paramat commented Sep 20, 2017

Why couldn't I just craft the goal item without making a transition item?

Because look at the crafting for a telescope, it is not possible to craft 2 telescope tubes side by side on a 3x3 grid, that's the only reason.

@C1ffisme

This comment has been minimized.

Show comment
Hide comment
@C1ffisme

C1ffisme Sep 20, 2017

@jastevenson303

this is a base subgame with the purpose of expansion.

That is still up for debate.

your point is lawed cl1ffisme.

How is repetitive, unnecessary gameplay allowable just because the game is meant to be expanded upon?

@paramat

Because look at the crafting for a telescope, it is not possible to craft 2 telescope tubes side by side on a 3x3 grid, that's the only reason.

You can almost make a crafting recipe for two tubes, it just looks ugly:
Binocular Craft

(Just so you know, I would gladly accept a monocular tube if you could craft a telescope or other item from it, because then it becomes "necessary". Maybe if you made a more general purpose "lense" item?)

C1ffisme commented Sep 20, 2017

@jastevenson303

this is a base subgame with the purpose of expansion.

That is still up for debate.

your point is lawed cl1ffisme.

How is repetitive, unnecessary gameplay allowable just because the game is meant to be expanded upon?

@paramat

Because look at the crafting for a telescope, it is not possible to craft 2 telescope tubes side by side on a 3x3 grid, that's the only reason.

You can almost make a crafting recipe for two tubes, it just looks ugly:
Binocular Craft

(Just so you know, I would gladly accept a monocular tube if you could craft a telescope or other item from it, because then it becomes "necessary". Maybe if you made a more general purpose "lense" item?)

@TumeniNodes

This comment has been minimized.

Show comment
Hide comment
@TumeniNodes

TumeniNodes Sep 20, 2017

Contributor

The "purpose", is to add an item to the zoom feature, which I feel is better than just having, seemingly , bionic eyes.
I don't see an issue with adding a bit of character to the game here & there. As a side note, "telescopes", had their specific uses on the low-end in military & topography, aside from astronomical uses with higher powered lenses.
For this reason, I see the telescope as a proper use in relation to Minetest Game

Contributor

TumeniNodes commented Sep 20, 2017

The "purpose", is to add an item to the zoom feature, which I feel is better than just having, seemingly , bionic eyes.
I don't see an issue with adding a bit of character to the game here & there. As a side note, "telescopes", had their specific uses on the low-end in military & topography, aside from astronomical uses with higher powered lenses.
For this reason, I see the telescope as a proper use in relation to Minetest Game

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Sep 22, 2017

Member

Yes i'll consider a single stage crafting, otherwise binoculars would require 6+6+1/2 ingots, which is a lot.

Member

paramat commented Sep 22, 2017

Yes i'll consider a single stage crafting, otherwise binoculars would require 6+6+1/2 ingots, which is a lot.

@GreenXenith

This comment has been minimized.

Show comment
Hide comment
@GreenXenith

GreenXenith Sep 29, 2017

Tin still has few uses (none). Perhaps both bronze and tin could be used to craft?

GreenXenith commented Sep 29, 2017

Tin still has few uses (none). Perhaps both bronze and tin could be used to craft?

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Sep 30, 2017

Member

Tin is already in bronze.

Member

paramat commented Sep 30, 2017

Tin is already in bronze.

@GreenXenith

This comment has been minimized.

Show comment
Hide comment
@GreenXenith

GreenXenith Sep 30, 2017

Tin is already in bronze

Whoops I knew that..

GreenXenith commented Sep 30, 2017

Tin is already in bronze

Whoops I knew that..

@jastevenson303

This comment has been minimized.

Show comment
Hide comment
@jastevenson303

jastevenson303 Oct 2, 2017

Contributor

I got an issue that there's no feedback on this, in-game when a player attempts to zoom and fails without the item. I'll likely file it on the tracker once this is merged, but it may be an engine issue.

How frustrating it would be, to set the zoom key in the settings menu, and then go to use it and wonder why it's not working.

Contributor

jastevenson303 commented Oct 2, 2017

I got an issue that there's no feedback on this, in-game when a player attempts to zoom and fails without the item. I'll likely file it on the tracker once this is merged, but it may be an engine issue.

How frustrating it would be, to set the zoom key in the settings menu, and then go to use it and wonder why it's not working.

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Oct 2, 2017

Member

That's probably because we are using 'player object properties' for zoom and these are otherwise not used for enabling an action, so there is no need for messages.
But maybe i can add feedback in the engine.

Member

paramat commented Oct 2, 2017

That's probably because we are using 'player object properties' for zoom and these are otherwise not used for enabling an action, so there is no need for messages.
But maybe i can add feedback in the engine.

@paramat paramat changed the title from Add telescope mod to Add binoculars mod Oct 3, 2017

@paramat paramat changed the title from Add binoculars mod to Add binoculars mod with binoculars item to allow zoom Oct 3, 2017

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Oct 3, 2017

Member

Code updated to binoculars and in a form consistent with map mod.
Just need to make a texture.

Member

paramat commented Oct 3, 2017

Code updated to binoculars and in a form consistent with map mod.
Just need to make a texture.

@Fixer-007

This comment has been minimized.

Show comment
Hide comment
@Fixer-007

Fixer-007 Oct 3, 2017

Contributor

Before merging this i don't want to see same debacle as with mapkit, i'm proposing to make it work like this:
You craft it, place it in your inventory, selecting binoculars in inventory turns on zoom immediately (there is no need for key presses or clicking anything, just select it in your hotbar as usual), changing selection to some other slot with other blocks turns off zoom immediately.

Contributor

Fixer-007 commented Oct 3, 2017

Before merging this i don't want to see same debacle as with mapkit, i'm proposing to make it work like this:
You craft it, place it in your inventory, selecting binoculars in inventory turns on zoom immediately (there is no need for key presses or clicking anything, just select it in your hotbar as usual), changing selection to some other slot with other blocks turns off zoom immediately.

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Oct 3, 2017

Member

I have just made the discussed improvements that were made to map mod.
No need to shout with bold font.
Your suggestion needs changes in the engine and we already plan to add inventory callbacks for instant response.
I disagree, see #1877 (comment)
Zoom should remain the 'Z' key as it is more usable than shifting hotbar selection, and players will usually want to keep a particular tool or weapon in hand while also being able to use zoom, as they can do now.

Member

paramat commented Oct 3, 2017

I have just made the discussed improvements that were made to map mod.
No need to shout with bold font.
Your suggestion needs changes in the engine and we already plan to add inventory callbacks for instant response.
I disagree, see #1877 (comment)
Zoom should remain the 'Z' key as it is more usable than shifting hotbar selection, and players will usually want to keep a particular tool or weapon in hand while also being able to use zoom, as they can do now.

@Fixer-007

This comment has been minimized.

Show comment
Hide comment
@Fixer-007

Fixer-007 Oct 3, 2017

Contributor

How can you look in binoculars and do something else at the same time, that's hardly possible (I have binoculars IRL). You zoom and place block/mine/use? Feels overpowered.

Contributor

Fixer-007 commented Oct 3, 2017

How can you look in binoculars and do something else at the same time, that's hardly possible (I have binoculars IRL). You zoom and place block/mine/use? Feels overpowered.

@paramat paramat removed the WIP label Oct 3, 2017

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Oct 3, 2017

Member

Added texture and tested, ready for review.

These victorian linear field glasses are small, can use in one hand.
Also, currently in MT players can use zoom while wielding something else, i feel we should keep that.

_58

Member

paramat commented Oct 3, 2017

Added texture and tested, ready for review.

These victorian linear field glasses are small, can use in one hand.
Also, currently in MT players can use zoom while wielding something else, i feel we should keep that.

_58

@jastevenson303

This comment has been minimized.

Show comment
Hide comment
@jastevenson303

jastevenson303 Oct 4, 2017

Contributor

@Fixer-007 What you say is interesting, and in terms of gameplay makes sense. However, this is too much for the sub-game; it's enough to ask the survivalist to at least have the item present.

TBF, zooming (which is really just an FOV change!) shouldn't ever be restricted or missing in the first place. And why we have to exit the game to change the FOV anyway is beyond my comprehension.

Contributor

jastevenson303 commented Oct 4, 2017

@Fixer-007 What you say is interesting, and in terms of gameplay makes sense. However, this is too much for the sub-game; it's enough to ask the survivalist to at least have the item present.

TBF, zooming (which is really just an FOV change!) shouldn't ever be restricted or missing in the first place. And why we have to exit the game to change the FOV anyway is beyond my comprehension.

@paramat paramat added the WIP label Oct 7, 2017

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Oct 7, 2017

Member

WIP a few final changes to make.

Member

paramat commented Oct 7, 2017

WIP a few final changes to make.

@TumeniNodes

This comment has been minimized.

Show comment
Hide comment
@TumeniNodes

TumeniNodes Oct 7, 2017

Contributor

@paramat just wanted to say, I wish I was aware the textures for this and map tool could be more than 16px ha but, want to say these textures you have done for both these PRs are very nice.

Contributor

TumeniNodes commented Oct 7, 2017

@paramat just wanted to say, I wish I was aware the textures for this and map tool could be more than 16px ha but, want to say these textures you have done for both these PRs are very nice.

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Oct 7, 2017

Member

I'm happy you like them.
32 pixel textures are not acceptable when the rest of MTGame uses 16 pixels.

Member

paramat commented Oct 7, 2017

I'm happy you like them.
32 pixel textures are not acceptable when the rest of MTGame uses 16 pixels.

Add binoculars mod with binoculars item to allow zoom
Uses the new player object property 'can zoom'.
In survival mode, use of zoom requires the binoculars item in
inventory.
Zoom is automatically allowed in creative mode and for players with
the 'creative' privilege.
The binoculars.update_player_property() function is global so can be
redefined by a mod for alternative behaviour.

@paramat paramat removed the WIP label Oct 7, 2017

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat

paramat Oct 7, 2017

Member

Updated.

For the map mod we intend to add an API that will display the minimap when the item is 'used'. However zoom is only in effect when the key is pressed, so doing the same here is not possible.
So i have re-added the instant allowance on item 'use', and therefore have increased the cyclic update interval to 5s as this now becomes less critical (actually 4.7 to be a prime of 0.1 and reduce syncing with other cycles).

Member

paramat commented Oct 7, 2017

Updated.

For the map mod we intend to add an API that will display the minimap when the item is 'used'. However zoom is only in effect when the key is pressed, so doing the same here is not possible.
So i have re-added the instant allowance on item 'use', and therefore have increased the cyclic update interval to 5s as this now becomes less critical (actually 4.7 to be a prime of 0.1 and reduce syncing with other cycles).

@SmallJoker

Works, code LGTM.

@paramat

This comment has been minimized.

Show comment
Hide comment
@paramat
Member

paramat commented Oct 13, 2017

@paramat paramat closed this Oct 13, 2017

@paramat paramat deleted the paramat:telescope branch Oct 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment