aliens

Author Topic: Impementing: Alien missions  (Read 9790 times)

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Impementing: Alien missions
« on: November 17, 2012, 11:29:00 am »
I have now all the relevant data for the missions (thanks Volutar), and started moving them to ruleset format.
Another commit and I'll even start producing actual missions!

feature/alien-missions
.
Please provide feedback and comments / suggestions.

edit: Updated link.
« Last Edit: November 29, 2012, 09:49:13 am by karvanit »

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Impementing: Alien missions
« Reply #1 on: November 27, 2012, 03:15:45 pm »
Ok, we now have ALL the mission data in ruleset format. Next few commits will implement alien missions.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Impementing: Alien missions
« Reply #2 on: November 27, 2012, 03:37:43 pm »
oh hells yes.

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Impementing: Alien missions
« Reply #3 on: November 28, 2012, 07:44:20 am »
It seems I am doing something wrong with the data, the UFOs keep landing in the sea. I'll have to visualize to check my errors / code, so this may take a while. The code on GitHub is mostly the same, but there are changes in my working version.

PS: Where do UFOs enter the game? Where do they leave?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Impementing: Alien missions
« Reply #4 on: November 28, 2012, 08:01:23 am »
make a call to ufo->insideLand() before switching to "landed" else move on to next waypoint?

idk, i'll clone what you got and take a look.

edit: should i be looking at the feature or wip alienmissions branch?

edit: edit: can you quickly explain how the waypoint information is stored?
what do these numbers mean?
      - [5, 4, 100]
« Last Edit: November 28, 2012, 08:14:37 am by Warboy1982 »

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Impementing: Alien missions
« Reply #5 on: November 28, 2012, 09:18:20 am »
First number is region zone (each zone has 1 - 10 areas), each region has 6 zones.
Second is altitude 0 = ground, 4 = very high
Final is speed%.

Use feature, wip is very old.

Volutar

  • Guest
Re: Impementing: Alien missions
« Reply #6 on: November 28, 2012, 09:39:17 am »
ufos are entering at 1st trajectory site (random sub-area and random location in it, like any other trajectory waypoint). and leaving after last one (tracking lost). landing in sea mean you're getting wrong location. there are only some of 6 area sets, which totally situated over lands. and only they are used as landing sites.

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Impementing: Alien missions
« Reply #7 on: November 28, 2012, 09:51:43 am »
Volutar, is the indexing of zones and subareas:
for each Region (0 .. 11, eg EUROPE, AMERICA):
  for each Zone (0 .. 5, 3 ==cities)
    for each subarea(0..9)

So first city in Europe should be: Region(EUROPE) * 60 + zone(3) * 10 + first city (0)
Or am I missing something?

And, are all subareas over respective regions? Because I get subareas over other regions (eg over Sahara for Europe).
PS: It seems that UFOs may land in any zone except 0 (1 in my data convertion).
« Last Edit: November 28, 2012, 10:04:01 am by karvanit »

Volutar

  • Guest
Re: Impementing: Alien missions
« Reply #8 on: November 28, 2012, 10:16:00 am »
karvanit, maybe IRC would be better for chat?

And not, you're not missing anything, but yaml structure with blocks of mins/maxs is not very intuitive and natural. Every area is globe square, having xmin/xmax/ymin/ymax coordinates. And it would be much better if each square will be [xmin, xmax, ymin, ymax] (like waypoints) in yaml and some tag of which zone it is. In your form I can't even say is it right. But obviously there is a lack of cities (which have zero width and height).

You can visualize almost correct areas with my globe editor ("almost" because box coordinate wrapping for polar zones is a mess).
« Last Edit: November 28, 2012, 10:25:26 am by Volutar »

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Impementing: Alien missions
« Reply #9 on: November 29, 2012, 09:49:51 am »
Ok, the code is in (still some missions to fix) and the PR send.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Impementing: Alien missions
« Reply #10 on: November 29, 2012, 10:49:59 am »
i guess i broke the PR since you sent it, mind resubmitting so i can give it a whirl?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Impementing: Alien missions
« Reply #11 on: November 29, 2012, 12:13:11 pm »
sadface, it compiles but it crashes out as soon as it tries to invoke AlienMission.h

something wrong in the declarations?
stacktrace seems to indicate a problem here:

   void setRegion(const std::string &region) { _region = region; }

Stacktrace:

Code: [Select]
KernelBase.dll!75d2c41f()
  [Frames below may be incorrect and/or missing, no symbols loaded for KernelBase.dll]
  KernelBase.dll!75d2c41f()
  msvcr100d.dll!_nh_malloc_dbg_impl(unsigned int nSize=1343209810, int nhFlag=-529697949, int nBlockUse=1, const char * szFileName=0x00000003, int nLine=1635056, int * errno_tmp=0x00000000)  Line 239 + 0x19 bytes C++
  0018f2fc()
  msvcr100d.dll!_CallSettingFrame(unsigned long funclet=1636968, unsigned long pRN=256, unsigned long dwInCode=1635224)  Line 73 Asm
  msvcr100d.dll!_CallCatchBlock2(EHRegistrationNode * pRN=0x0018fa68, const _s_FuncInfo * pFuncInfo=0x0086a524, void * handlerAddress=0x0042a187, int CatchDepth=0, unsigned long NLGCode=256)  Line 508 + 0x11 bytes C++
  msvcr100d.dll!CallCatchBlock(EHExceptionRecord * pExcept=0x0018f61c, EHRegistrationNode * pRN=0x0018fa68, _CONTEXT * pContext=0x0018f66c, const _s_FuncInfo * pFuncInfo=0x0086a524, void * handlerAddress=0x0042a187, int CatchDepth=0, unsigned long NLGCode=256)  Line 1458 + 0x19 bytes C++
  msvcr100d.dll!CatchIt(EHExceptionRecord * pExcept=0x0018f61c, EHRegistrationNode * pRN=0x0018fa68, _CONTEXT * pContext=0x0018f66c, void * pDC=0x0018f5f0, const _s_FuncInfo * pFuncInfo=0x0086a524, const _s_HandlerType * pCatch=0x0086a4e4, const _s_CatchableType * pConv=0x5014cdc0, const _s_TryBlockMapEntry * pEntry=0x0086a55c, int CatchDepth=0, EHRegistrationNode * pMarkerRN=0x00000000, unsigned char IsRethrow=0)  Line 1269 + 0x25 bytes C++
  msvcr100d.dll!FindHandler(EHExceptionRecord * pExcept=0x0018f61c, EHRegistrationNode * pRN=0x0018fa68, _CONTEXT * pContext=0x0018f66c, void * pDC=0x0018f5f0, const _s_FuncInfo * pFuncInfo=0x0086a524, unsigned char recursive=0, int CatchDepth=0, EHRegistrationNode * pMarkerRN=0x00000000)  Line 766 + 0x32 bytes C++
  msvcr100d.dll!__InternalCxxFrameHandler(EHExceptionRecord * pExcept=0x0018f61c, EHRegistrationNode * pRN=0x0018fa68, _CONTEXT * pContext=0x0018f66c, void * pDC=0x0018f5f0, const _s_FuncInfo * pFuncInfo=0x0086a524, int CatchDepth=0, EHRegistrationNode * pMarkerRN=0x00000000, unsigned char recursive=0)  Line 516 + 0x26 bytes C++
  msvcr100d.dll!__CxxFrameHandler3(EHExceptionRecord * pExcept=0x0018fa68, EHRegistrationNode * pRN=0x0018f66c, void * pContext=0x0018f5f0, void * pDC=0x0018fa68)  Line 361 + 0x1f bytes C++
  ntdll.dll!76f0b459()
  ntdll.dll!76f0b42b()
  ntdll.dll!76f0b3ce()
  ntdll.dll!76ec0133()
  KernelBase.dll!75d2c41f()
  msvcr100d.dll!_unlock(int locknum=8)  Line 375 C
  msvcr100d.dll!_unlockexit()  Line 785 + 0x7 bytes C
  msvcr100d.dll!_CxxThrowException(void * pExceptionObject=0x0018f9f4, const _s__ThrowInfo * pThrowInfo=0x5014cd78)  Line 157 C++
  msvcr100d.dll!operator new(unsigned int size=4277075696)  Line 64 C++
  OpenXcom.exe!std::_Allocate<char>(unsigned int _Count=4277075696, char * __formal=0x00000000)  Line 36 + 0xf bytes C++
  OpenXcom.exe!std::allocator<char>::allocate(unsigned int _Count=4277075696)  Line 187 + 0xb bytes C++
  OpenXcom.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Copy(unsigned int _Newsize=4277075694, unsigned int _Oldlen=0)  Line 1933 + 0x12 bytes C++
  OpenXcom.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::_Grow(unsigned int _Newsize=4277075694, bool _Trim=false)  Line 1963 + 0x13 bytes C++
  OpenXcom.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right=<Bad Ptr>, unsigned int _Roff=0, unsigned int _Count=4294967295)  Line 902 + 0xe bytes C++
  OpenXcom.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::assign(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right=<Bad Ptr>)  Line 889 C++
  OpenXcom.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::operator=(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & _Right=<Bad Ptr>)  Line 765 C++
> OpenXcom.exe!OpenXcom::AlienMission::setRegion(const std::basic_string<char,std::char_traits<char>,std::allocator<char> > & region=<Bad Ptr>)  Line 64 + 0x1d bytes C++
  OpenXcom.exe!OpenXcom::GeoscapeState::determineAlienMissions(bool atGameStart=true)  Line 1736 C++
  OpenXcom.exe!OpenXcom::GeoscapeState::think()  Line 410 C++
  OpenXcom.exe!OpenXcom::Game::run()  Line 233 + 0x28 bytes C++
  OpenXcom.exe!SDL_main(int argc=3, char * * args=0x003d8410)  Line 69 C++
  OpenXcom.exe!_main()  + 0x133 bytes C
  OpenXcom.exe!__tmainCRTStartup()  Line 555 + 0x19 bytes C
  OpenXcom.exe!mainCRTStartup()  Line 371 C
  kernel32.dll!74a833aa()
  ntdll.dll!76ee9ef2()
  ntdll.dll!76ee9ec5()
  OpenXcom.exe!std::_Tree<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,OpenXcom::RuleInventory *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,OpenXcom::RuleInventory *> >,0> >::_Erase(std::_Tree_nod<std::_Tmap_traits<std::basic_string<char,std::char_traits<char>,std::allocator<char> >,OpenXcom::RuleInventory *,std::less<std::basic_string<char,std::char_traits<char>,std::allocator<char> > >,std::allocator<std::pair<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const ,OpenXcom::RuleInventory *> >,0> >::_Node * _Rootnode=0x04c483fc)  Line 1621 + 0xa bytes C++
  458bffd7()