Page 8 of 16

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Wed Apr 22, 2020 7:53 am
by NilsZ
Wesley wrote:
Wed Apr 22, 2020 7:30 am
Image

How do you know? Does the new format have an extension?

If we have enough information certain individuals might be able to identify what should be changed...
yes of course. I mean the .i3d files.

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Mon Apr 27, 2020 1:45 am
by KiloEcho
I greatly appreciate your efforts towards both improving the appearance of each models hands and for returning unique
character faces to the team members within your modification projects.
Picture from Bergamo #2.png
enter code "funnyhead"
Picture from Bergamo #2.png (1.68 MiB) Viewed 19558 times
I have found that while using the extended DTA files contained in version HDX1.2a the replacement Italian SMG soldiers
appear equipped with Sten guns rather than the Beretta M1938. (Listed +[49] Item in Inventory table.) The Carcano 1891 you added in position +[51] is indeed present and functional.
Picture from Bergamo #1.png
C1M2 Italian replacement soldier using Sten gun
Picture from Bergamo #1.png (647.58 KiB) Viewed 19558 times
It is only because I would really like to encounter and fire this new weapon that I mention it here. Maybe I will manage to locate this model and its textures within a previous installation package for this mod. I can have a closer look in the data files in an attempt to identify the issue and hopefully restore the machine gun that you have intended for use by these enemies we must face in Italy 1,2,and 3.
Please continue working on extending the life and level of enjoyment still to be found within these Hidden and Dangerous missions.
Each of you guys level of dedication deserves much admiration. All of your modding and editing work is highly anticipated and very well received by this enthusiast of what I consider among the most memorable game play and environments to ever be realized.

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Mon Apr 27, 2020 11:03 am
by p.jakub88
KiloEcho wrote:
Mon Apr 27, 2020 1:45 am

I have found that while using the extended DTA files contained in version HDX1.2a the replacement Italian SMG soldiers
appear equipped with Sten guns rather than the Beretta M1938. It is only because I would really like to encounter and fire this new weapon that I mention it here. I can have a closer look in the data files in an attempt to identify the issue and hopefully restore the machine gun that you have intended for use in Italy 1,2,and 3.
Well, i have a working Beretta M1938 submachine-gun for the Italian campaign (as well as the Carcano rifle) in my "H&D Deluxe Ultimate Mod": https://www.moddb.com/mods/hd-deluxe-ul ... imate-mod1

You could see the MAB-38 and Carcano in action in this video: https://www.moddb.com/mods/hd-deluxe-ul ... timate-mod

Both models were imported from Medal of Honor: Breakthrough PC game.

See pictures below. :cool:

NilsZ could use the Beretta M1938 model from my "H&D Deluxe Ultimate Mod" if he wants to. thup01

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Mon Apr 27, 2020 4:23 pm
by NilsZ
Thanks for your help Jakub :)
I really need to make an update. I will try to make it in this week.

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Tue Apr 28, 2020 12:06 am
by Myron
When it's finished, will distinct faces be adopted and integrated into the Ultimate Overhaul?

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Tue Apr 28, 2020 7:13 am
by p.jakub88
Myron wrote:
Tue Apr 28, 2020 12:06 am
When it's finished, will distinct faces be adopted and integrated into the Ultimate Overhaul?
I don't know how to do that actually. Maybe if NilsZ tell me how to do it, that would be possible.

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Tue Apr 28, 2020 9:00 am
by NilsZ
Myron wrote:
Tue Apr 28, 2020 12:06 am
When it's finished, will distinct faces be adopted and integrated into the Ultimate Overhaul?
Of course. As we decided to cooperate we are exchanging our files and knowledge.

@Jakub:
I just made 4 different player models and picked some faces from the Faces folder in maps.dta.
It's not like in the original game where the faces will be loaded each mission.
Unluckily in missions were different uniforms are used this tactic can't be used. If the soldier has a unique model the game will give the "couldn't find current clothing" error and give him the standard SAS uniform. So these missions must still use clone models.

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Tue Apr 28, 2020 9:08 am
by p.jakub88
NilsZ wrote:
Tue Apr 28, 2020 9:00 am
Myron wrote:
Tue Apr 28, 2020 12:06 am
When it's finished, will distinct faces be adopted and integrated into the Ultimate Overhaul?
Of course. As we decided to cooperate we are exchanging our files and knowledge.

@Jakub:
I just made 4 different player models and picked some faces from the Faces folder in maps.dta.
It's not like in the original game where the faces will be loaded each mission.
Unluckily in missions were different uniforms are used this tactic can't be used. If the soldier has a unique model the game will give the "couldn't find current clothing" error and give him the standard SAS uniform. So these missions must still use clone models.
Thanks for the info NilsZ! thup01

So, since there is no way to properly implement unique SAS soldiers faces in all missions - like it was in classic H&D 1 - i will stay with the generic faces in my H&D Deluxe Ultimate Mod.

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Tue Apr 28, 2020 1:04 pm
by mr.47
Lets start writing the code on Python first and then we will continue with C++.

Python:
Start with importing numpy module and opencv module.

import numpy as np
import cv2 as cv

Now, we will use the following Haar Cascade Classifier for our face detection code.
haarcascade_frontalface_default.xml - Pre Trained model for face detection

Let us load these cascades in our code.

face_cascade = cv.CascadeClassifier('\\cv2\\data\\haarcascade_frontalface_default.xml')
eye_cascade = cv.CascadeClassifier('\\cv2\\data\\haarcascade_eye.xml')

Now, we need to load the image in which we want to run our face detection algorithm. For this article we will be using the traditional OpenCV 'lenna' image as following.



Load this image in our code and convert it into grayscale.
img = cv.imread('lenna.jpg')
gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY)

Our image is now ready for the face cacade to be applied on. We use detectMultiScale function for detecting faces in the image along with our face detection cascade that we have loaded earlier in our code.

faces = face_cascade.detectMultiScale(gray, 1.3, 5)

Here 1.3 is the scale factor and 5 is minNeighbours.
scaleFactor – Parameter specifying how much the image size is reduced at each image scale.
minNeighbors – Parameter specifying how many neighbors each candidate rectangle should have to retain it.

Now face detection is done and all the faces found in the image are stored in the array faces. Now, lets draw rectangles around the detected faces in our image.

for (x,y,w,h) in faces:
cv.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
roi_gray = gray[y:y+h, x:x+w]
roi_color = img[y:y+h, x:x+w]

We are almost done with our face detection code and we just need to show our new image with detected faces. For that we have the following snippet of code.

cv.imshow('Face_Detect',img)
cv.waitKey(0)
cv.destroyAllWindows()

This is the resultant image that we get as per our input image.


That's it. We have successfully detected faces in an image using OpenCV and Python. Now try detecting different objects using different Haar Casacades in the OpenCV library. Well, you can even make a Haar cascase of your own! Provided you have a lot of pictures of your target object. This is beyond the scope of this article though.

C++:
Let's include all the required headers for our code:

#include "opencv2/objdetect.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/imgproc.hpp"
#include <iostream>

using namespace std;
using namespace cv;

objdetect.hpp -
Object detection module in OpenCV.

highgui.hpp -
It provides easy interface to:

Create and manipulate windows that can display images
Add trackbars to the windows
Read and write images to/from disk or memory.
Read video from camera or file and write video to a file.

imgproc.hpp -
It provides a lot of functions for processing images such as image filtering and geometric transformations.

Now, we write a function that takes in an input image and cascade classifier as argument and gives a output image after applying face detection algorithm.

void detectAndDraw( Mat& img, CascadeClassifier& cascade, double scale)

This is our function definition and we continue with writing the function body. First we initialize a vector for storing all the faces that our algorithm will detect and convert our imput image into grayscale.

vector<Rect> faces;
Mat gray;
cvtColor( img, gray, COLOR_BGR2GRAY );

We will now apply detectMultiScale function on our grayscale image.

cascade.detectMultiScale( gray, faces, 1.1, 2, 0|CASCADE_SCALE_IMAGE, Size(30, 30) );

This function is similar to what we used in python. Face detection is now done and we need to draw rectangles around the detected faces.

for ( size_t i = 0; i < faces.size(); i++ )
{
Rect r = faces;
Scalar color = Scalar(255, 0, 0);
rectangle( img, cvPoint(cvRound(r.x*scale), cvRound(r.y*scale)), cvPoint(cvRound((r.x +
r.width-1)*scale), cvRound((r.y + r.height-1)*scale)), color, 3, 8, 0);
}

Now we just need to show our result as follows.

imshow( "Face Detection", img );

That's it now we can simply call our detection function and get faces detected in a go.

int main()
{
// Load the cascade classifier
cascade.load( "../../haarcascade_frontalcatface.xml" ) ;
double scale=1;
frame = imread('lenna.jpg', CV_LOAD_IMAGE_COLOR);
detectAndDraw( frame, cascade, scale );
return 0;
}

imread() is used to load the input image. In this case it is the same 'lenna' image that we used in python code.

Result for our C++ code is:


That's it we have successfully detected faces in an image using OpenCV and C++.
these are just examples of how you add faces i any game based on character or type if i had the tools to break through the engine that would be fine to do that but we still in the begining :)

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Tue Apr 28, 2020 4:24 pm
by Myron
Truly, that is sad; I was looking forward to the extra dose of nostalgia. Everyone looking like clones in Deluxe is just wrong.

BTW, Jakub, what do you think about the stone road that NilsZ put in his version of Danube 3?

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Tue Apr 28, 2020 4:44 pm
by p.jakub88
Myron wrote:
Tue Apr 28, 2020 4:24 pm
Truly, that is sad; I was looking forward to the extra dose of nostalgia. Everyone looking like clones in Deluxe is just wrong.

BTW, Jakub, what do you think about the stone road that NilsZ put in his version of Danube 3?
The road looks very good in my opinion. However, i like the default texture too.

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Tue Apr 28, 2020 8:24 pm
by NilsZ
OK guys, i made now the update. It has only a few changes, not too much:
Beretta M1938 and Carcano have now models (thanks to p.Jakub88)
new fire texture
radio targeting system can now be choosen again in norway mission
old menu soundtracks are now combined with the new ones
MG sound in C3M6 is now available again
new crosshairs for all sniper rifles

The next thing i want to work is on uniform textures.
DL Link:
https://www.dropbox.com/s/lvbbccstjjd3k ... .3.7z?dl=0

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Wed Apr 29, 2020 2:42 pm
by Myron
Hey NilsZ, were you the one who made the music mod that Jakub adopted?

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Wed Apr 29, 2020 2:59 pm
by p.jakub88
Myron wrote:
Wed Apr 29, 2020 2:42 pm
Hey NilsZ, were you the one who made the music mod that Jakub adopted?
You mean the one i gave you the link to?

It was uploaded by _HellBaron_ on Mod DB: https://www.moddb.com/games/hidden-dang ... -music-mod

Re: HIDDEN AND DANGEROUS EXTENDED

Posted: Wed Apr 29, 2020 3:19 pm
by Myron
Ah, okay, thanks. :)