project-navigation
Personal tools

Author Topic: Fix for bug #1890695 -- what should be the desired behaviour  (Read 6393 times)

nemchenk

  • Guest
Fix for bug #1890695 -- what should be the desired behaviour
« on: February 19, 2008, 02:00:08 pm »
I'm looking at fixing bug #1890695, where craftitems mounted on an aircraft that is sold disappear from the player's inventory.

The bug poster wants these items to be added to the base Stores, but it occurs to me that this would make for an exploit! Normally, it takes several hours to remove items from an aircraft. This would allow the player to do it instantly! Say I decide I can't wait 24 hours to take the armour off my Firebird and put it on my Stiletto -- I sell the Stiletto, then buy it back. Hey presto, I have armour ready to install, instantly.

Do we care? Should I submit a patch that pops up a "You cannot sell this aircraft as it has equipment installed. You must remove all equipment before sale."? This solution is simpler to code :P and has the merits of using existing "game rules" instead of introducing new ones. However, it means more micro-management for the player :(

Or shall we just let this slight workaround exist, given that stuff sells for 90% of its value at the moment? This lets the player have what he wants, and NOW, but at the risk of creating a slight "bug" in the game.

Perhaps the third solution is best, but the most difficult? :D The aircraft is "queued" for decommissioning -- it is sold once all gear is removed from it. Is the craft available for use while gear is being stripped from it? Or does it disappear from the inventory straight away, and some hours later money and craft items appear?

Or even: do it XCOM3-style. Add the price of the items to the craft sale price?

What do you think?

Offline kracken

  • Squad Leader
  • ****
  • Posts: 159
    • View Profile
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #1 on: February 19, 2008, 02:10:35 pm »
The bug poster wants these items to be added to the base Stores, but it occurs to me that this would make for an exploit! Normally, it takes several hours to remove items from an aircraft.
You're right, I didn't think about that when I commited this bug.

I think the best solution is to sell items at the same time than the aircraft. Anyway, we will probably need to add some delay in the futur when you buy items before being able to use them (at the moment, there's no point in transfering items. For example: if you sell an item in one base and buy it in another one, you will manage to perform an immediate transfer)

You can't sell items at 90% of their price because this is not what is done when you sell them directly. The "queue for decommissioning" seems difficult IMHO.
« Last Edit: February 19, 2008, 02:17:48 pm by kracken »

nemchenk

  • Guest
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #2 on: February 19, 2008, 02:23:41 pm »
Hi Kracken :)

You can't sell items at 90% of their price because this is not what is done when you sell them directly.
Beg your pardon, but it is: try buying something, then selling it immediately. You will loose 10% of its value :) I think it is undocumented, but it is happening.

Offline kracken

  • Squad Leader
  • ****
  • Posts: 159
    • View Profile
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #3 on: February 19, 2008, 02:35:34 pm »
Hi Kracken :)
Beg your pardon, but it is: try buying something, then selling it immediately. You will loose 10% of its value :) I think it is undocumented, but it is happening.
Sorry, I can't try it at the moment, but I didn't know that :P
Anyway, you should sell it at the same amount than if you sell the item in the airequip menu.
« Last Edit: February 19, 2008, 03:08:54 pm by kracken »

nemchenk

  • Guest
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #4 on: February 19, 2008, 03:05:53 pm »
Ok, I see :)

Would anyone else care to comment, so we can build an idea of everyone's thoughts on the matter?

nemchenk

  • Guest
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #5 on: February 19, 2008, 08:55:41 pm »
I will implement what kracken suggested in the next day or two, then. :)

i.e. sell the equipment on the craft at the same time it is being sold.

nemchenk

  • Guest
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #6 on: February 20, 2008, 04:56:17 pm »
Patch #1897990. Have a nice day :)

nemchenk

  • Guest
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #7 on: February 20, 2008, 05:20:16 pm »
Incidentally, I see that when an aircraft is sold, it is sold for 100% of its price. Is that desirable behaviour, or a bug? Namely:
Code: [Select]
CL_UpdateCredits(ccs.credits + ccs.eMarket.bid[craftitemID]);
vs
CL_UpdateCredits(ccs.credits + aircraft_samples[aircraftID].price);

Let me know which way you want it and I will submit a patch :)

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #8 on: February 20, 2008, 08:06:01 pm »
imo the market bid value - but i haven't looked at the code

SpaceWombat

  • Guest
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #9 on: February 21, 2008, 12:39:57 am »
When the item is mounted at another aircraft the delay for remounting is taken into account. The question is whether the item should be unavailable for some time, right?
I would say unmounting is faster than mounting since you do not need to test its operability etc. Too complicated and too little effect imho.

Just put it into the storage where it belongs.  ;D

nemchenk

  • Guest
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #10 on: February 28, 2008, 05:27:39 pm »
imo the market bid value - but i haven't looked at the code
Well, the quick'n'easy hack is just to multiply the price by the BID_FACTOR. Shall I do this as a WIP-type solution?

It seems aircraft are not handled as part of the market -- is there a reason for this other than it has not been implemented yet? It seems odd to exclude them like this -- shall I have a look at adding them?

Offline kracken

  • Squad Leader
  • ****
  • Posts: 159
    • View Profile
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #11 on: February 28, 2008, 08:51:20 pm »
It seems aircraft are not handled as part of the market -- is there a reason for this other than it has not been implemented yet?
What do you mean ? What would you want to do  ? Sorry, I don't understand

nemchenk

  • Guest
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #12 on: February 28, 2008, 11:53:54 pm »
Oh, sorry :) I'll explain more.

Aircraft don't behave like craftitems or items -- they are not specified in campaign_market (in equipment.ufo), their costs are not adjusted in cl_campaign.c#CL_CampaignRunMarket(), there is always MAX_AIRCRAFT of them, etc.

Offline kracken

  • Squad Leader
  • ****
  • Posts: 159
    • View Profile
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #13 on: February 29, 2008, 08:45:19 am »
Oh, sorry :) I'll explain more.
no problem ;)

Aircraft don't behave like craftitems or items -- they are not specified in campaign_market (in equipment.ufo), their costs are not adjusted in cl_campaign.c#CL_CampaignRunMarket(), there is always MAX_AIRCRAFT of them, etc.
Yes, it should probably be changed so that number and prices of aircraft are adjusted during the game.
Zenerka mentioned that he wanted to remove aircraft from objDef_t. So you should ask him what he plans to do, to make sure that you don't code something for nuts  ;)

nemchenk

  • Guest
Re: Fix for bug #1890695 -- what should be the desired behaviour
« Reply #14 on: February 29, 2008, 11:05:52 am »
SF Feautre Request #1904561 posted.

Should I commit my "nasty hack" to SVN?